Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/08/09 12:48:18 (15 years ago)
Author:
gkronber
Message:

Merged change sets from CEDMA branch to trunk:

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.Server/Server.cs

    r1044 r1287  
    5151
    5252    public Server(IStore store) {
    53       // windows XP returns the external ip on index 0 while windows vista returns the external ip on index 2
     53      IPAddress[] addresses = Dns.GetHostAddresses(Dns.GetHostName());
     54      // windows XP returns the external ip on index 0 while windows vista returns the external ip as one of the last entries
     55      // also if IPv6 protocol is installed we want to find an entry that is IPv4
     56      int index = 0;
    5457      if (System.Environment.OSVersion.Version.Major >= 6) {
    55         cedmaServiceUrl = "net.tcp://" + Dns.GetHostAddresses(Dns.GetHostName())[2] + ":8002/CEDMA/World";
    56       } else {
    57         cedmaServiceUrl = "net.tcp://" + Dns.GetHostAddresses(Dns.GetHostName())[0] + ":8002/CEDMA/World";
     58        for (index = addresses.Length - 1; index >= 0; index--)
     59          if (addresses[index].AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
     60            break;
    5861      }
     62      cedmaServiceUrl = "net.tcp://" + addresses[index] + ":8002/CEDMA";
    5963      this.store = store;
    6064    }
     
    6771      try {
    6872        NetTcpBinding binding = new NetTcpBinding();
    69         binding.MaxReceivedMessageSize = 100000000; // 100Mbytes
    70         binding.ReaderQuotas.MaxStringContentLength = 100000000; // also 100M chars
    71         binding.ReaderQuotas.MaxArrayLength = 100000000; // also 100M elements;
    72         binding.Security.Mode = SecurityMode.None;
    73 
     73        binding.SendTimeout = new TimeSpan(1, 0, 0);
     74        binding.MaxReceivedMessageSize = 1000000000; // 100Mbytes
     75        binding.ReaderQuotas.MaxStringContentLength = 1000000000; // also 100M chars
     76        binding.ReaderQuotas.MaxArrayLength = 1000000000; // also 100M elements;
    7477        host.AddServiceEndpoint(typeof(IStore), binding, cedmaServiceUrl);
    7578        host.Open();
Note: See TracChangeset for help on using the changeset viewer.