Free cookie consent management tool by TermsFeed Policy Generator

Changeset 804


Ignore:
Timestamp:
11/23/08 00:11:22 (16 years ago)
Author:
kgrading
Message:

quick fixed the IPv6 problem (#384)

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs

    r798 r804  
    3535using HeuristicLab.Hive.Contracts.BusinessObjects;
    3636using HeuristicLab.Hive.Contracts;
     37using System.Runtime.Remoting.Messaging;
    3738
    3839
    3940namespace HeuristicLab.Hive.Client.Core {
    4041  public class Core {
     42
     43    public delegate string GetASnapshotDelegate();
    4144
    4245    Dictionary<long, Executor> engines = new Dictionary<long, Executor>();
     
    120123          break;
    121124        case MessageContainer.MessageType.SnapshotReady:
    122           engines[container.JobId].GetSnapshot();
     125          //Grabbing of the snapshot will need some time, so let's make this functun async
     126          GetASnapshotDelegate ssd = new GetASnapshotDelegate(engines[container.JobId].GetSnapshot);
     127          ssd.BeginInvoke(new AsyncCallback(SnapshotReceived), null);
     128          //engines[container.JobId].GetSnapshot();
    123129          break;
    124130
     
    138144          break;
    139145      }
     146    }
     147
     148    void SnapshotReceived(IAsyncResult res) {
     149      AsyncResult ar = (AsyncResult) res;
     150      GetASnapshotDelegate gss = (GetASnapshotDelegate) ar.AsyncDelegate;
     151      String objectRepr = gss.EndInvoke(res);
    140152    }
    141153
  • trunk/sources/HeuristicLab.Hive.Server/HiveServerApplication.cs

    r800 r804  
    119119
    120120    public override void Run() {
    121       string externalIP =
    122         Dns.GetHostEntry(Dns.GetHostName()).AddressList[0].ToString();
     121        IPAddress[] addresses = Dns.GetHostAddresses(Dns.GetHostName());
     122        int index = 0;
     123        if (System.Environment.OSVersion.Version.Major >= 6) {
     124          for (index = addresses.Length - 1; index >= 0; index--)
     125            if (addresses[index].AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
     126              break;
     127        }
    123128
    124129      Uri uriTcp =
    125           new Uri("net.tcp://" + externalIP + ":" + port + "/HiveServer/");
     130          new Uri("net.tcp://" + addresses[index] + ":" + port + "/HiveServer/");
    126131
    127132      ServiceHost clientCommunicator =
     
    129134
    130135      uriTcp =
    131         new Uri("net.tcp://" + externalIP + ":" + port + "/HiveServerConsole/");
     136        new Uri("net.tcp://" + addresses[index] + ":" + port + "/HiveServerConsole/");
    132137
    133138      ServiceHost serverConsoleFacade =
Note: See TracChangeset for help on using the changeset viewer.