public static void Close() { Flush(); if (m_Server != null) { try { m_Server.Shutdown(SocketShutdown.Both); } catch { } try { m_Server.Close(); } catch { } m_Server = null; } if (m_Logger != null) { m_Logger.WriteLine(); m_Logger.WriteLine("#####\tEnding packet log on {0}\t#####", DateTime.Now); m_Logger.Flush(); m_Logger.Close(); m_Logger = null; } if (m_Protocol != null) { m_Protocol.WriteLine(); m_Protocol.WriteLine("#####\tEnding protocol log on {0}\t#####", DateTime.Now); m_Protocol.Flush(); m_Protocol.Close(); m_Protocol = null; } m_ServerIP = null; m_ServerIPEP = null; m_ServerHost = null; m_Tree = null; m_Buffer = null; OnRecv = null; OnSend = null; OnPacketHandle = null; m_Table = null; m_UnpackBuffer = null; m_OutputBuffer = null; m_CryptoProvider = null; }