/// <summary> /// Dispose. /// </summary> public void Dispose() { lock (_syncObject) { if (IsDisposed) { return; } IsDisposed = true; } if (TextReader != null) { try { TextReader.Dispose(); } catch (ObjectDisposedException) { } TextReader = null; } if (TextWriter != null) { try { TextWriter.Dispose(); } catch (ObjectDisposedException) { } TextWriter = null; } if (Stream != null) { try { Stream.Dispose(); } catch (ObjectDisposedException) { } } if (HyperVSocket != null) { try { HyperVSocket.Dispose(); } catch (ObjectDisposedException) { } } }
public void Close() { Stream.Dispose(); HyperVSocket.Dispose(); }