public void Dispose() { DataStream?.Close(); DataStream?.Dispose(); ControlStream?.Close(); ControlStream?.Dispose(); IsAlive = false; }
protected virtual void Dispose(bool disposing) { if (!_disposed) { if (disposing) { if (ControlClient != null) { ControlClient.Close(); } if (ControlStream != null) { ControlStream.Close(); } } } _disposed = true; OnDisposed(); }