Changeset 805 for trunk/sources/HeuristicLab.Hive.Server
- Timestamp:
- 11/23/08 18:05:59 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server/HiveServerApplication.cs
r804 r805 36 36 AutoRestart = true)] 37 37 class HiveServerApplication : ApplicationBase { 38 const int port = 38 const int port = 39 39 9000; 40 40 … … 43 43 44 44 private bool AddMexEndpoint(ServiceHost serviceHost) { 45 if (serviceHost != null) {45 if (serviceHost != null) { 46 46 ServiceMetadataBehavior behavior = 47 47 new ServiceMetadataBehavior(); 48 48 serviceHost.Description.Behaviors.Add(behavior); 49 49 50 51 52 53 50 return serviceHost.AddServiceEndpoint( 51 typeof(IMetadataExchange), 52 MetadataExchangeBindings.CreateMexTcpBinding(), 53 "mex") != null; 54 54 } else 55 55 return false; … … 119 119 120 120 public override void Run() { 121 122 123 124 125 126 127 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 } 128 128 129 129 Uri uriTcp = 130 130 new Uri("net.tcp://" + addresses[index] + ":" + port + "/HiveServer/"); 131 131 132 ServiceHost clientCommunicator = 132 ServiceHost clientCommunicator = 133 133 StartClientCommunicator(uriTcp); 134 134
Note: See TracChangeset
for help on using the changeset viewer.