protected virtual void Dispose(bool disposing) { if (disposing) { if (waveSocket != null) { waveSocket.Dispose(); } if (waveDataproc != null) { waveDataproc.Dispose(); } if (StartRcvEvent != null) { StartRcvEvent.Dispose(); } if (StartRcvEvent != null) { StartRcvEvent.Dispose(); } if (RcvThread != null) { RcvThread.Abort(); RcvThread = null; } IsBuilded = false; IsStopRcved = true; linkbuffer.Clear(); Console.WriteLine(@"关闭UDP线程..."); } }
public virtual void Dispose() { try { RcvThread.Abort(); } catch { } try { SendThread.Abort(); } catch { } _newRcvTelegram.Dispose(); _newSendTelegram.Dispose(); _newSendNotifyTelegram.Dispose(); }
public void StopReceiveData() { StartRcvEvent.Reset(); RcvThread.Abort(); }