Changeset 7135
- Timestamp:
- 12/06/11 14:30:47 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Clients.Hive.Slave.Views/3.3
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.Hive.Slave.Views/3.3/Properties/Settings.Designer.cs
r7132 r7135 71 71 } 72 72 } 73 74 [global::System.Configuration.UserScopedSettingAttribute()] 75 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 76 [global::System.Configuration.DefaultSettingValueAttribute("00:00:20")] 77 public global::System.TimeSpan ServiceStartStopTimeout { 78 get { 79 return ((global::System.TimeSpan)(this["ServiceStartStopTimeout"])); 80 } 81 set { 82 this["ServiceStartStopTimeout"] = value; 83 } 84 } 85 86 [global::System.Configuration.UserScopedSettingAttribute()] 87 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 88 [global::System.Configuration.DefaultSettingValueAttribute("00:00:03")] 89 public global::System.TimeSpan ServiceReconnectTimeout { 90 get { 91 return ((global::System.TimeSpan)(this["ServiceReconnectTimeout"])); 92 } 93 set { 94 this["ServiceReconnectTimeout"] = value; 95 } 96 } 73 97 } 74 98 } -
trunk/sources/HeuristicLab.Clients.Hive.Slave.Views/3.3/Properties/Settings.settings
r7132 r7135 15 15 <Value Profile="(Default)">HeuristicLab.Clients.Hive.Slave</Value> 16 16 </Setting> 17 <Setting Name="ServiceStartStopTimeout" Type="System.TimeSpan" Scope="User"> 18 <Value Profile="(Default)">00:00:20</Value> 19 </Setting> 20 <Setting Name="ServiceReconnectTimeout" Type="System.TimeSpan" Scope="User"> 21 <Value Profile="(Default)">00:00:03</Value> 22 </Setting> 17 23 </Settings> 18 24 </SettingsFile> -
trunk/sources/HeuristicLab.Clients.Hive.Slave.Views/3.3/SlaveCmdsWithKill.cs
r6983 r7135 126 126 127 127 private void StartService() { 128 TimeSpan timeout = TimeSpan.FromMilliseconds(5000);129 130 128 ServiceController service = new ServiceController(serviceName); 131 129 try { 132 130 if (service.Status == ServiceControllerStatus.Running) { 133 131 service.Stop(); 134 service.WaitForStatus(ServiceControllerStatus.Stopped, timeout);132 service.WaitForStatus(ServiceControllerStatus.Stopped, Settings.Default.ServiceStartStopTimeout); 135 133 } 136 134 137 135 service.Start(); 138 service.WaitForStatus(ServiceControllerStatus.Running, timeout);136 service.WaitForStatus(ServiceControllerStatus.Running, Settings.Default.ServiceStartStopTimeout); 139 137 } 140 138 catch (InvalidOperationException ex) { … … 147 145 148 146 private void StopService() { 149 TimeSpan timeout = TimeSpan.FromMilliseconds(7000);150 151 147 ServiceController service = new ServiceController(serviceName); 152 148 try { 153 149 if (service.Status == ServiceControllerStatus.Running) { 154 150 service.Stop(); 155 service.WaitForStatus(ServiceControllerStatus.Stopped, timeout);151 service.WaitForStatus(ServiceControllerStatus.Stopped, Settings.Default.ServiceStartStopTimeout); 156 152 } 157 153 } 158 154 catch (InvalidOperationException ex) { 159 MessageBox.Show("Error st arting service: Hive Slave Service not found!" + Environment.NewLine + ex.ToString());155 MessageBox.Show("Error stopping service: Hive Slave Service not found!" + Environment.NewLine + ex.ToString()); 160 156 } 161 157 catch (Exception ex) { 162 MessageBox.Show("Error st arting service, exception is: " + Environment.NewLine + ex.ToString());158 MessageBox.Show("Error stopping service, exception is: " + Environment.NewLine + ex.ToString()); 163 159 } 164 160 } -
trunk/sources/HeuristicLab.Clients.Hive.Slave.Views/3.3/SlaveItem.cs
r6983 r7135 91 91 public bool ReconnectToSlaveCore() { 92 92 try { 93 DeregisterEvents(); 93 94 pipeProxy = pipeFactory.CreateChannel(); 94 95 StatusCommons st = pipeProxy.Subscribe(); 95 96 if (st != null) { 97 RegisterEvents(); 96 98 OnStatusChanged(st); 97 99 return true; -
trunk/sources/HeuristicLab.Clients.Hive.Slave.Views/3.3/SlaveMainViewBase.cs
r6983 r7135 62 62 protected override void DeregisterContentEvents() { 63 63 Content.CoreConnectionChanged -= new EventHandler<Common.EventArgs<CoreConnection>>(Content_CoreConnectionChanged); 64 Content.SlaveDisplayStateChanged -= new EventHandler<Common.EventArgs<SlaveDisplayStat>>(Content_SlaveDisplayStateChanged); 64 65 base.DeregisterContentEvents(); 65 66 } … … 68 69 base.RegisterContentEvents(); 69 70 Content.CoreConnectionChanged += new EventHandler<Common.EventArgs<CoreConnection>>(Content_CoreConnectionChanged); 71 Content.SlaveDisplayStateChanged += new EventHandler<Common.EventArgs<SlaveDisplayStat>>(Content_SlaveDisplayStateChanged); 72 } 73 74 void Content_SlaveDisplayStateChanged(object sender, Common.EventArgs<SlaveDisplayStat> e) { 75 if (e.Value == SlaveDisplayStat.NoService) { 76 Task.Factory.StartNew(Connector); 77 } 70 78 } 71 79 72 80 void Content_CoreConnectionChanged(object sender, Common.EventArgs<CoreConnection> e) { 73 81 if (e.Value == CoreConnection.Offline) { 74 Connector();82 Task.Factory.StartNew(Connector); 75 83 } 76 84 } … … 119 127 120 128 if (!connected) { 121 Thread.Sleep( 1000);129 Thread.Sleep(Settings.Default.ServiceReconnectTimeout); 122 130 } 123 131 } -
trunk/sources/HeuristicLab.Clients.Hive.Slave.Views/3.3/app.config
r7132 r7135 20 20 <value>HeuristicLab.Clients.Hive.Slave</value> 21 21 </setting> 22 <setting name="ServiceStartStopTimeout" serializeAs="String"> 23 <value>00:00:20</value> 24 </setting> 25 <setting name="ServiceReconnectTimeout" serializeAs="String"> 26 <value>00:00:03</value> 27 </setting> 22 28 </HeuristicLab.Clients.Hive.SlaveCore.Views.Properties.Settings> 23 29 </userSettings>
Note: See TracChangeset
for help on using the changeset viewer.