Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/22/11 16:44:28 (13 years ago)
Author:
ascheibe
Message:

#1233 various slave and slave tray icon improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/SlaveCommListener.cs

    r5711 r5795  
    2222using System;
    2323using System.ServiceModel;
     24using System.Threading;
    2425using HeuristicLab.Clients.Hive.SlaveCore.ServiceContracts;
    2526
     
    3637    public void Open() {
    3738      pipeFactory = new DuplexChannelFactory<ISlaveCommunication>(this, "SlaveCommunicationServiceEndpoint");
    38       pipeProxy = pipeFactory.CreateChannel();
    39       pipeProxy.Subscribe();
     39
     40      while (!ReconnectToSlaveCore()) {
     41        Thread.Sleep(500);
     42      }
     43    }
     44
     45    public bool ReconnectToSlaveCore() {
     46      try {
     47        pipeProxy = pipeFactory.CreateChannel();
     48        pipeProxy.Subscribe();
     49        return true;
     50      }
     51      catch (Exception e) {
     52        OnMessageLogged("Couldn't connect to Slave core. Is it possible that the Slave Core isn't running?\nException is: " + e.ToString());
     53        return false;
     54      }
    4055    }
    4156
Note: See TracChangeset for help on using the changeset viewer.