Пример #1
0
 public void ProcessIO()
 {
     IsRunning = true;
     while (IsRunning)
     {
         try
         {
             while (ReceiveQueue.Count > 0)
             {
                 ReceiveQueue.TryDequeue(out var msg);
                 msg = Decrypt(msg);
                 OnIncommeingMessage?.Invoke(msg, Id);
                 Console.WriteLine("{0}{1}Received: {2}", Id, Helper.SocketMessageAttributeSeperator, msg);
             }
         }
         catch (Exception)
         {
         }
         finally
         {
         }
     }
 }
Пример #2
0
        public void ProcessIO()
        {
            IsRunning = true;
            while (IsRunning)
            {
                try

                {
                    if (ReceiveQueue.Count > 0)
                    {
                        while (ReceiveQueue.Count > 0)
                        {
                            ReceiveQueue.TryDequeue(out var msg);

                            msg = Decrypt(msg);

                            OnIncommeingMessage?.Invoke(msg);
                            Console.WriteLine("Received: {0}", msg);
                        }
                    }
                }
                catch (Exception) { }
            }
        }