Changeset 1097
- Timestamp:
- 01/08/09 17:00:09 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Client.Communication/WcfService.cs
r1082 r1097 48 48 proxy.SendHeartBeatCompleted += new EventHandler<SendHeartBeatCompletedEventArgs>(proxy_SendHeartBeatCompleted); 49 49 proxy.Open(); 50 if (ConnState == NetworkEnum.WcfConnState.Failed)51 ConnectionRestored(this, new EventArgs());52 50 53 51 ConnState = NetworkEnum.WcfConnState.Connected; 54 ConnectedSince = DateTime.Now; 52 ConnectedSince = DateTime.Now; 53 55 54 if (Connected != null) 56 55 Connected(this, new EventArgs()); 56 57 if (ConnState == NetworkEnum.WcfConnState.Failed) 58 ConnectionRestored(this, new EventArgs()); 57 59 } 58 60 catch (Exception ex) { … … 93 95 NetworkErrorHandling(e.Error.InnerException); 94 96 } 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 95 110 #endregion 96 111 … … 139 154 } 140 155 141 #endregion 142 156 #endregion 143 157 } 144 158 } -
trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs
r1085 r1097 58 58 59 59 private WcfService wcfService; 60 private Heartbeat beat; 60 61 61 62 public void Start() { … … 82 83 } 83 84 84 Heartbeatbeat = new Heartbeat { Interval = 10000 };85 beat = new Heartbeat { Interval = 10000 }; 85 86 beat.StartHeartbeat(); 86 87 … … 120 121 case MessageContainer.MessageType.Shutdown: 121 122 ShutdownFlag = true; 123 beat.StopHeartBeat(); 122 124 break; 123 125 } … … 192 194 193 195 void wcfService_ServerChanged(object sender, EventArgs e) { 196 Logging.GetInstance().Info(this.ToString(), "ServerChanged has been called"); 194 197 lock (Locker) { 195 198 foreach (KeyValuePair<long, AppDomain> entries in appDomains) … … 201 204 202 205 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 - 206 210 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 } 208 220 } 209 221 -
trunk/sources/HeuristicLab.Hive.Client.Core/Heartbeat.cs
r1031 r1097 90 90 e.Result.ActionRequest.ForEach(mc => MessageQueue.GetInstance().AddMessage(mc)); 91 91 } 92 93 public void StopHeartBeat() { 94 heartbeatTimer.Dispose(); 95 } 92 96 } 93 97 } -
trunk/sources/HeuristicLab.Hive.Client.ExecutionEngine/Executor.cs
r1001 r1097 38 38 public MessageContainer.MessageType CurrentMessage { get; set; } 39 39 public MessageQueue Queue { get; set; } 40 public bool Running { 41 get { 42 return Job.Running; 43 } 44 } 40 45 public double Progress { 41 46 get {
Note: See TracChangeset
for help on using the changeset viewer.