/// <summary> /// /// </summary> void StopMonitorClient() { if (MonitorClient == null) { return; } MonitorClient.ClientReadyForCommunications -= MonitorClient_IsReadyForComm; MonitorClient.Disconnect(); MonitorClient = null; }
/// <summary> /// /// </summary> void RunMonitorClient() { MonitorClient = new GenericTcpIpClient_ForServer(Key + "-MONITOR", "127.0.0.1", Port, 2000); MonitorClient.SharedKeyRequired = this.SharedKeyRequired; MonitorClient.SharedKey = this.SharedKey; MonitorClient.ConnectionHasHungCallback = MonitorClientHasHungCallback; //MonitorClient.ConnectionChange += MonitorClient_ConnectionChange; MonitorClient.ClientReadyForCommunications += MonitorClient_IsReadyForComm; Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Starting monitor check"); MonitorClient.Connect(); // From here MonitorCLient either connects or hangs, MonitorClient will call back }