public void Close(bool isOpen) { try { if (isOpen) { try { packet.Clear(); packet.WriteByte((byte)DBCmd.QUIT); ExecutePacket(packet); } catch (Exception) { // Eat exception here. We should try to closing // the stream anyway. } } if (stream != null) { stream.Dispose(); } stream = null; } catch (Exception) { // we are just going to eat any exceptions // generated here } }