private void CheckConnected_Thread() { while (_ConnectedOKEvent.WaitOne(int.MaxValue)) { try { if (_Channel.Echo("hello") == "hello") //如果返回的与发送的不一样,就说明通道已经出错 { _ConnectedOKEvent.Set(); Thread.Sleep(1000 * 5); } else { ParkingAdapter_ParkAdapterConnectFail(this, EventArgs.Empty); return; } } catch { ParkingAdapter_ParkAdapterConnectFail(this, EventArgs.Empty); } } }