protected virtual void Dispose(bool disposing) { if (!isDisposed || disposing) { try { sock.Shutdown(SocketShutdown.Both); sock.Close(); for (int i = 0; i < SocketAsynPool.Count; i++) { SocketAsyncEventArgs args = SocketAsynPool.Pop(); BuffManagers.FreeBuffer(args); } ReceiveThread.Abort(); } catch { } isDisposed = true; } }
public static void UnInit() { ReceiveThread.Abort(); ReceiveThread = null; Client.Close(); Client = null; }
public static void UnInit() { ReceiveThread.Abort(); ReceiveThread = null; Server.Dispose(); Server.Close(); Server = null; }
public void Dispose() { isConnected = false; if (client != null) { client.Disconnect(); } _thread.Abort(); values = new ValueGroupCtl(); }
public bool StopExchange() { m_bRun = false; _device.CloseCan(); try { if ((ReceiveThread.ThreadState & (ThreadState.Stopped | ThreadState.Unstarted)) == 0) { ReceiveThread.Abort(); ReceiveThread.Join(); //Thread stops } } catch { return(false); } return(true); }
/// <summary> /// Suspends the listening for incoming PDU's. /// </summary> public void StopListening() { FlushBuffer(); ReceiveThread.Abort(); }