Free cookie consent management tool by TermsFeed Policy Generator

Changeset 805


Ignore:
Timestamp:
11/23/08 18:05:59 (16 years ago)
Author:
kgrading
Message:

work on #385, core problem still exists.

Location:
trunk/sources
Files:
4 edited

Legend:

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

    r793 r805  
    1313        proxy = new ClientCommunicatorClient(
    1414          new NetTcpBinding(),
    15           new EndpointAddress("net.tcp://10.20.53.1:9000/HiveServer/ClientCommunicator")
     15          new EndpointAddress("net.tcp://192.168.132.1:9000/HiveServer/ClientCommunicator")
    1616          );
    1717      }
  • trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs

    r804 r805  
    6767
    6868    public void Start() {
    69       Heartbeat beat = new Heartbeat { Interval = 5000 };
     69      Heartbeat beat = new Heartbeat { Interval = 30000 };
    7070      beat.StartHeartbeat();
    7171
  • trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs

    r797 r805  
    1313  public class ClientCommunicator: IClientCommunicator {
    1414    List<ClientInfo> clients;
    15     List<long> jobs;
     15    LinkedList<long> jobs;
    1616    int nrOfJobs = 10;
    1717
    1818    public ClientCommunicator() {
    19       jobs = new List<long>();
    20       for (int i = 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);
    2222      }
    2323    }
     
    5454    public ResponseJob PullJob(Guid clientId) {
    5555      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     
    5861      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";     
    6263      return response;
    6364    }
     
    7071      return response;
    7172    }
    72 
     73                           
    7374    public Response Logout(Guid clientId) {
    7475      bool clientRemoved = false;
  • trunk/sources/HeuristicLab.Hive.Server/HiveServerApplication.cs

    r804 r805  
    3636      AutoRestart = true)]
    3737  class HiveServerApplication : ApplicationBase {
    38     const int port = 
     38    const int port =
    3939      9000;
    4040
     
    4343
    4444    private bool AddMexEndpoint(ServiceHost serviceHost) {
    45       if(serviceHost != null) {
     45      if (serviceHost != null) {
    4646        ServiceMetadataBehavior behavior =
    4747            new ServiceMetadataBehavior();
    48           serviceHost.Description.Behaviors.Add(behavior);
     48        serviceHost.Description.Behaviors.Add(behavior);
    4949
    50           return serviceHost.AddServiceEndpoint(
    51             typeof(IMetadataExchange),
    52             MetadataExchangeBindings.CreateMexTcpBinding(),
    53             "mex") != null;
     50        return serviceHost.AddServiceEndpoint(
     51          typeof(IMetadataExchange),
     52          MetadataExchangeBindings.CreateMexTcpBinding(),
     53          "mex") != null;
    5454      } else
    5555        return false;
     
    119119
    120120    public override void Run() {
    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         }
     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      }
    128128
    129129      Uri uriTcp =
    130130          new Uri("net.tcp://" + addresses[index] + ":" + port + "/HiveServer/");
    131131
    132       ServiceHost clientCommunicator = 
     132      ServiceHost clientCommunicator =
    133133        StartClientCommunicator(uriTcp);
    134134
Note: See TracChangeset for help on using the changeset viewer.