Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1097


Ignore:
Timestamp:
01/08/09 17:00:09 (16 years ago)
Author:
kgrading
Message:

various changes (#457)

Location:
trunk/sources
Files:
4 edited

Legend:

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

    r1082 r1097  
    4848        proxy.SendHeartBeatCompleted += new EventHandler<SendHeartBeatCompletedEventArgs>(proxy_SendHeartBeatCompleted);
    4949        proxy.Open();
    50         if (ConnState == NetworkEnum.WcfConnState.Failed)
    51           ConnectionRestored(this, new EventArgs());
    5250
    5351        ConnState = NetworkEnum.WcfConnState.Connected;
    54         ConnectedSince = DateTime.Now;       
     52        ConnectedSince = DateTime.Now;
     53       
    5554        if (Connected != null)
    5655          Connected(this, new EventArgs());                               
     56       
     57        if (ConnState == NetworkEnum.WcfConnState.Failed)
     58          ConnectionRestored(this, new EventArgs());       
    5759      }
    5860      catch (Exception ex) {
     
    9395        NetworkErrorHandling(e.Error.InnerException);
    9496    }
     97
     98    public void LoginSync(ClientInfo clientInfo) {
     99      try {
     100        if (ConnState == NetworkEnum.WcfConnState.Connected) {
     101          Response res = proxy.Login(clientInfo);
     102          Logging.GetInstance().Info(this.ToString(), res.StatusMessage);
     103        }
     104      }
     105      catch (Exception e) {
     106        NetworkErrorHandling(e);
     107      }
     108    }
     109
    95110    #endregion
    96111
     
    139154    }
    140155
    141     #endregion
    142 
     156    #endregion 
    143157  }
    144158}
  • trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs

    r1085 r1097  
    5858
    5959    private WcfService wcfService;
     60    private Heartbeat beat;
    6061
    6162    public void Start() {
     
    8283      }
    8384   
    84       Heartbeat beat = new Heartbeat { Interval = 10000 };
     85      beat = new Heartbeat { Interval = 10000 };
    8586      beat.StartHeartbeat();     
    8687
     
    120121        case MessageContainer.MessageType.Shutdown:
    121122          ShutdownFlag = true;
     123          beat.StopHeartBeat();
    122124          break;
    123125      }
     
    192194
    193195    void wcfService_ServerChanged(object sender, EventArgs e) {
     196      Logging.GetInstance().Info(this.ToString(), "ServerChanged has been called");
    194197      lock (Locker) {
    195198        foreach (KeyValuePair<long, AppDomain> entries in appDomains)
     
    201204
    202205    void wcfService_Connected(object sender, EventArgs e) {
    203       wcfService.LoginAsync(ConfigManager.Instance.GetClientInfo());
    204     }
    205 
     206      wcfService.LoginSync(ConfigManager.Instance.GetClientInfo());
     207    }
     208
     209    //this is a little bit tricky -
    206210    void wcfService_ConnectionRestored(object sender, EventArgs e) {
    207       //Do some fancy new things here... e.g: check all appdomains if there are still active Jobs that need to be transmitted
     211      Logging.GetInstance().Info(this.ToString(), "Reconnected to old server - checking currently running appdomains");                 
     212
     213      foreach (KeyValuePair<long, Executor> execKVP in engines) {
     214        if (!execKVP.Value.Running && execKVP.Value.CurrentMessage == MessageContainer.MessageType.NoMessage) {
     215          Logging.GetInstance().Info(this.ToString(), "Checking for JobId: " + execKVP.Value.JobId);
     216          Thread finThread = new Thread(new ParameterizedThreadStart(GetFinishedJob));
     217          finThread.Start(execKVP.Value.JobId);
     218        }
     219      }
    208220    }
    209221
  • trunk/sources/HeuristicLab.Hive.Client.Core/Heartbeat.cs

    r1031 r1097  
    9090      e.Result.ActionRequest.ForEach(mc => MessageQueue.GetInstance().AddMessage(mc));
    9191    }
     92
     93    public void StopHeartBeat() {
     94      heartbeatTimer.Dispose();
     95    }
    9296  }
    9397}
  • trunk/sources/HeuristicLab.Hive.Client.ExecutionEngine/Executor.cs

    r1001 r1097  
    3838    public MessageContainer.MessageType CurrentMessage { get; set; }
    3939    public MessageQueue Queue { get; set; }
     40    public bool Running {
     41      get {
     42        return Job.Running;
     43      }
     44    }
    4045    public double Progress {
    4146      get {
Note: See TracChangeset for help on using the changeset viewer.