public NetState() { _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); _recvBuffer = new BufferPool("Receive Buffer", 16, 4096); _messagePump = new MessagePump(); _buffer = new ByteQueue(); }
public void Dispose() { if (_socket == null || _isDisposing) { return; } _isDisposing = true; try { _socket.Shutdown(SocketShutdown.Both); } catch (SocketException ex) { Tracer.Error(ex); } try { _socket.Close(); } catch (SocketException ex) { Tracer.Error(ex); } _socket = null; _buffer = null; }
public void Dispose() { if (_socket == null || _isDisposing) return; _isDisposing = true; try { _socket.Shutdown(SocketShutdown.Both); } catch (SocketException ex) { Tracer.Error(ex); } try { _socket.Close(); } catch (SocketException ex) { Tracer.Error(ex); } _socket = null; _buffer = null; }