Changeset 5795 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveItem.cs
- Timestamp:
- 03/22/11 16:44:28 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveItem.cs
r5599 r5795 31 31 [Item("SlaveItem", "Represents a slave which receives messages from the core")] 32 32 public class SlaveItem : Item, ISlaveCommunicationCallbacks, IDisposable { 33 ISlaveCommunication pipeProxy;34 DuplexChannelFactory<ISlaveCommunication> pipeFactory;33 private ISlaveCommunication pipeProxy; 34 private DuplexChannelFactory<ISlaveCommunication> pipeFactory; 35 35 36 36 public SlaveItem() { … … 62 62 63 63 public void Open() { 64 //TODO: read info from app.config65 pipeFactory = new DuplexChannelFactory<ISlaveCommunication>(this,66 new NetNamedPipeBinding(), new EndpointAddress("net.pipe://localhost/HeuristicLabSlaveCom"));64 pipeFactory = new DuplexChannelFactory<ISlaveCommunication>(this, "SlaveCommunicationServiceEndpoint"); 65 RegisterEvents(); 66 } 67 67 68 pipeProxy = pipeFactory.CreateChannel(); 69 RegisterEvents(); 70 68 public bool ReconnectToSlaveCore() { 71 69 try { 70 pipeProxy = pipeFactory.CreateChannel(); 72 71 pipeProxy.Subscribe(); 72 return true; 73 73 } 74 74 catch (Exception e) { 75 75 OnMessageLogged("Couldn't connect to Slave core. Is it possible that the Slave Core isn't running?\nException is: " + e.ToString()); 76 return false; 76 77 } 77 78 } 78 79 79 public void ReconnectToSlaveCore() { 80 try { 81 pipeProxy = pipeFactory.CreateChannel(); 82 pipeProxy.Subscribe(); 83 } 84 catch (Exception e) { 85 OnMessageLogged("Couldn't connect to Slave core. Is it possible that the Slave Core isn't running?\nException is: " + e.ToString()); 86 } 87 } 88 89 public bool isClosed() { 80 public bool IsClosed() { 90 81 if (pipeFactory == null) return true; 91 return pipeFactory.State == CommunicationState.Closed ;82 return pipeFactory.State == CommunicationState.Closed || pipeFactory.State == CommunicationState.Faulted; 92 83 } 93 84
Note: See TracChangeset
for help on using the changeset viewer.