예제 #1
0
 private void ReceiveAll()
 {
     while (true)
     {
         _network.Receive(_server);
         IMessage      m = null;
         UnpackerState s;
         s = _converter.ConvertToReceive(ref m, _server);
         if (s == UnpackerState.Ok)
         {
             _messagesManager.SetMessage(m);
         }
         else if (s == UnpackerState.NotReady)
         {
             return;
         }
         else
         {
             throw new System.SystemException("hoho");
         }
     }
 }
예제 #2
0
 private void ReceiveAll()
 {
     foreach (IUserNetwork user in _clients)
     {
         while (true)
         {
             _network.Receive(user);
             IMessage      m = null;
             UnpackerState s = _converter.ConvertToReceive(ref m, user);
             if (s == UnpackerState.Ok)
             {
                 _messagesManager.SetMessage(m);
             }
             else if (s == UnpackerState.NotReady)
             {
                 break;
             }
             else
             {
                 throw new System.SystemException("hoho");
             }
         }
     }
 }