public void Disconnect() { if (!Connected) { throw new ProtocolException("Connection error: Not connected to server."); } _stream.Disconnect(false); }