/// <summary> /// Task for the receive <see cref="Thread" />. /// </summary> private void ReceiveTask() { while (true) { while (this._receiveQueue.TryDequeue(out NetPacket packet)) { NetMessage message = packet.GetNetMessage(); if (message != null) { message.Decode(); this._messageManager.ReceiveMessage(message); } packet.Destruct(); } Thread.Sleep(1); } }