Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/20/08 13:11:55 (16 years ago)
Author:
abeham
Message:

Fixed startup bug in ServerForm when no external interface is connected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Grid/ServerForm.cs

    r401 r578  
    4545      InitializeComponent();
    4646
    47       // windows XP returns the external ip on index 0 while windows vista returns the external ip on index 2
     47      IPAddress[] addresses = Dns.GetHostAddresses(Dns.GetHostName());
     48      // windows XP returns the external ip on index 0 while windows vista returns the external ip on index 2 (presumably in the last entry, which normally is 2)
     49      int index = 0;
    4850      if (System.Environment.OSVersion.Version.Major >= 6) {
    49         externalAddressTextBox.Text = "net.tcp://" + Dns.GetHostAddresses(Dns.GetHostName())[2] + ":8000/Grid/Service";
    50         internalAddressTextBox.Text = "net.tcp://" + Dns.GetHostAddresses(Dns.GetHostName())[2] + ":8001/Grid/JobStore";
    51       } else {
    52         externalAddressTextBox.Text = "net.tcp://" + Dns.GetHostAddresses(Dns.GetHostName())[0] + ":8000/Grid/Service";
    53         internalAddressTextBox.Text = "net.tcp://" + Dns.GetHostAddresses(Dns.GetHostName())[0] + ":8001/Grid/JobStore";
     51        index = addresses.Length - 1;
    5452      }
     53      externalAddressTextBox.Text = "net.tcp://" + addresses[index] + ":8000/Grid/Service";
     54      internalAddressTextBox.Text = "net.tcp://" + addresses[index] + ":8001/Grid/JobStore";
     55
    5556      jobStore = new EngineStore();
    5657      server = new GridServer(jobStore);
Note: See TracChangeset for help on using the changeset viewer.