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
}
}