Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/23/08 18:40:38 (15 years ago)
Author:
gkronber
Message:

worked on executer which retrieves the next job from the dispatcher and sends it to the grid for execution. #419 (Refactor CEDMA plugins)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/Server.cs

    r1044 r1060  
    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    }
Note: See TracChangeset for help on using the changeset viewer.