Changeset 924


Ignore:
Timestamp:
12/07/08 16:52:28 (12 years ago)
Author:
kgrading
Message:

added a connectionRestored Event (#418)

Location:
trunk/sources
Files:
2 edited

Legend:

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

    r923 r924  
    2222    }
    2323
    24     public enum ConnectionState { connected, disconnected, failed };
     24    public enum ConnectionState { connected, disconnected, failed } 
     25    public ConnectionState ConnState { get; set; }
     26
     27    public event EventHandler ConnectionRestored;   
    2528
    2629    private ClientCommunicatorClient proxy = null;
    27 
    28     public ConnectionState ConnState { get; set; }
    29 
    3030    private string serverIP;
    3131    private string serverPort;
     
    4646        proxy.SendJobResultCompleted += new EventHandler<SendJobResultCompletedEventArgs>(proxy_SendJobResultCompleted);
    4747        proxy.SendHeartBeatCompleted += new EventHandler<SendHeartBeatCompletedEventArgs>(proxy_SendHeartBeatCompleted);
     48
     49        if (ConnState == ConnectionState.failed)
     50          ConnectionRestored(this, new EventArgs());
     51        ConnState = ConnectionState.connected;
     52
    4853      }
    4954      catch (Exception ex) {
  • trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs

    r923 r924  
    6666      wcfService.PullJobCompleted += new EventHandler<PullJobCompletedEventArgs>(wcfService_PullJobCompleted);
    6767      wcfService.SendJobResultCompleted += new EventHandler<SendJobResultCompletedEventArgs>(wcfService_SendJobResultCompleted);
     68      wcfService.ConnectionRestored += new EventHandler(wcfService_ConnectionRestored);
    6869
    6970      wcfService.LoginAsync(ConfigurationManager.GetInstance().GetClientInfo());
     
    127128    #region wcfService Events
    128129
     130    void wcfService_ConnectionRestored(object sender, EventArgs e) {
     131      //Do some fancy new things here... e.g: check all appdomains if there are still active Jobs that need to be transmitted
     132    }
     133
    129134    void wcfService_LoginCompleted(object sender, LoginCompletedEventArgs e) {
    130135      if (e.Result.Success) {
Note: See TracChangeset for help on using the changeset viewer.