コード例 #1
0
 private void RawReception()
 {
     while (m_RawSocket != null && m_RawSocket.Connected)
     {
         byte[] buffer = new byte[m_RawSocket.Available];
         if (buffer.Length != 0)
         {
             m_RawSocket.Receive(buffer);
             m_MessageInformations.ParseBuffer(buffer);
         }
     }
 }
コード例 #2
0
 private void SocketReception()
 {
     try
     {
         m_MessageInformations = new MessageInformations(account);
         while ((m_Socket != null) && (Connected()))
         {
             byte[] buffer = new byte[m_Socket.Available];
             if (buffer.Length != 0)
             {
                 m_Socket.Receive(buffer);
                 account.LatencyFrame.UpdateLatency();
                 m_MessageInformations.ParseBuffer(buffer);
             }
         }
         if (!m_ForcedDisconnect)
         {
             account.Log(
                 new ErrorTextInformation("La connexion a été interrompue à cause d'une raison inconnue."), 0);
             if (account.IsMITM)
             {
                 account.Log(new ErrorTextInformation("MITM : Impossible de se reconnecter."), 0);
                 DisconnectServer();
             }
             else
             {
                 account.TryReconnect(2);
             }
         }
         m_ForcedDisconnect = false;
     }
     catch (SocketException ex)
     {
         account.Log(new ErrorTextInformation(ex.Message + ex.StackTrace), 0);
     }
 }
コード例 #3
0
 private void client_DataArrived(object sender, NetSockDataArrivalEventArgs e)
 {
     m_MessageInformations.ParseBuffer(e.Data);
     account.LatencyFrame.UpdateLatency();
 }