Exemple #1
0
 private void Disconnect()
 {
     try
     {
         if (client != null)
         {
             if (client.Connected)
             {
                 client.Disconnect(true);
             }
             client = null;
         }
         socketEvent.ClientDisconnect(this);
     }
     catch (Exception e)
     {
         LogManger.Instance.Error(e);
     }
     finally
     {
         isConnect = false;
         if (m_HeaderThread != null)
         {
             m_HeaderThread.Abort();
         }
     }
 }
 private void Disconnect()
 {
     try
     {
         if (client != null)
         {
             server.RemoveClient(this);
             client.Disconnect(true);
             client = null;
         }
         if (socketEvent != null)
         {
             socketEvent.ClientDisconnect(server, this);
         }
     }
     catch (Exception e)
     {
         LogManger.Instance.Error(e);
     }
 }