public void Close(bool isOpen) { try { if (isOpen) { try { packet.Clear(); packet.WriteByte((byte)DBCmd.QUIT); ExecutePacket(packet); } catch (Exception ex) { MySqlTrace.LogError(ThreadId, ex.ToString()); // Eat exception here. We should try to closing // the stream anyway. } } if (stream != null) { stream.Close(); } stream = null; } catch (Exception) { // we are just going to eat any exceptions // generated here } }
protected override void Dispose(bool disposing) { if (disposing) { try { if (isOpen) { ExecuteCommand(DBCmd.QUIT, null, 0); } if (stream != null) { stream.Close(); } stream = null; } catch (Exception) { // we are just going to eat any exceptions // generated here } } base.Dispose(disposing); }
public override void Close() { try { if (isOpen) { ExecuteCommand(DBCmd.QUIT, null, 0); } if (stream != null) { stream.Close(); } stream = null; base.Close(); } catch (Exception) { // we are just going to eat any exceptions // generated here } }