/// <summary>
        /// Adds a command to the end of the incoming queue.
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        private bool EnqueueIncomingCommand(IncomingCommand command)
        {
            UdpChannel channel;

            if (!_channels.TryGetValue(command.Channel, out channel))
            {
                Log(LogLevel.Error, "Received a command for non-existing channel: {0}", command.Channel);
                return(false);
            }

            ReceiveQueueBase receiveQueue = command.IsReliable ? channel.ReliableReceiveQueue : channel.UnreliableReceiveQueue;

            return(receiveQueue.EnqueueIncomingCommand(command));
        }
        internal UdpChannel(ConnectionConfig config, byte channelNumber, int initialCapacity)
        {
            _config = config;

            ChannelNumber = channelNumber;

            _reliableReceiveQueue   = new ReliableReceiveQueue(this, initialCapacity);
            _unreliableReceiveQueue = new UnreliableReceiveQueue(this, initialCapacity);

            _reliableSendQueue   = new ReliableSendQueue(this, initialCapacity);
            _unreliableSendQueue = new UnreliableSendQueue(this, initialCapacity);

            _ackQueue = new AckSendQueue(this, initialCapacity);
        }