Changeset 805 for trunk/sources
- Timestamp:
- 11/23/08 18:05:59 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Client.Communication/ServiceLocator.cs
r793 r805 13 13 proxy = new ClientCommunicatorClient( 14 14 new NetTcpBinding(), 15 new EndpointAddress("net.tcp://1 0.20.53.1:9000/HiveServer/ClientCommunicator")15 new EndpointAddress("net.tcp://192.168.132.1:9000/HiveServer/ClientCommunicator") 16 16 ); 17 17 } -
trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs
r804 r805 67 67 68 68 public void Start() { 69 Heartbeat beat = new Heartbeat { Interval = 5000 };69 Heartbeat beat = new Heartbeat { Interval = 30000 }; 70 70 beat.StartHeartbeat(); 71 71 -
trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs
r797 r805 13 13 public class ClientCommunicator: IClientCommunicator { 14 14 List<ClientInfo> clients; 15 Li st<long> jobs;15 LinkedList<long> jobs; 16 16 int nrOfJobs = 10; 17 17 18 18 public ClientCommunicator() { 19 jobs = new Li st<long>();20 for ( inti = 1; i < nrOfJobs; i++) {21 jobs.Add (i);19 jobs = new LinkedList<long>(); 20 for (long i = 1; i < nrOfJobs; i++) { 21 jobs.AddFirst(i); 22 22 } 23 23 } … … 54 54 public ResponseJob PullJob(Guid clientId) { 55 55 ResponseJob response = new ResponseJob(); 56 57 response.JobId = jobs.ElementAt(jobs.Count); 56 lock (this) { 57 response.JobId = jobs.Last.Value; 58 jobs.RemoveLast(); 59 } 60 58 61 response.Success = true; 59 response.StatusMessage = "Job with id " + jobs.Count + " sent"; 60 jobs.Remove(jobs.Count); 61 62 response.StatusMessage = "Job with id " + jobs.Count + " sent"; 62 63 return response; 63 64 } … … 70 71 return response; 71 72 } 72 73 73 74 public Response Logout(Guid clientId) { 74 75 bool clientRemoved = false; -
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.