- Timestamp:
- 12/23/08 18:40:38 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/Server.cs
r1044 r1060 51 51 52 52 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; 54 57 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; 58 61 } 62 cedmaServiceUrl = "net.tcp://" + addresses[index] + ":8002/CEDMA"; 59 63 this.store = store; 60 64 }
Note: See TracChangeset
for help on using the changeset viewer.