public virtual void Close() { if (ReadStream != null) { ReadStream.Flush(); ReadStream.Dispose(); } if (WriteStream != null) { WriteStream.Flush(); WriteStream.Dispose(); } if (Socket != null) { Socket.Dispose(); } }