예제 #1
0
        /// <summary>
        ///
        /// </summary>
        void StopMonitorClient()
        {
            if (MonitorClient == null)
            {
                return;
            }

            MonitorClient.ClientReadyForCommunications -= MonitorClient_IsReadyForComm;
            MonitorClient.Disconnect();
            MonitorClient = null;
        }
예제 #2
0
        /// <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
        }