コード例 #1
0
 /// <summary>
 /// 读取消息线程
 /// </summary>
 private void OnreadMsgThread()
 {
     while (ReceiveBuffQue.Count > 0)
     {
         int    channel = 0;
         int    type    = 0;
         int    userId  = 0;
         int    roomId  = 0;
         byte[] msgByte = ReceiveBuffQue.Dequeue();
         byte[] data    = DeCoderMsg(msgByte, out channel, out type, out userId, out roomId);
         if (SendChanneled.ContainsKey(channel))
         {
             SendChanneled.Remove(channel);
         }
         if (channel == 0)
         {
             string result = "";
             for (int i = 0; i < msgByte.Length; i++)
             {
                 result += " " + msgByte[i];
             }
             NSocket.LogError("收到空消息" + result);
         }
         NSocket.OnReceiveBuff(channel, type, data);
     }
 }