Beispiel #1
0
        public NetReliableOrderedReceiver(NetConnection connection, int windowSize)
            : base(connection)
        {
            LidgrenException.AssertIsPowerOfTwo((ulong)windowSize, nameof(windowSize));

            _windowSize      = windowSize;
            _earlyReceived   = new NetBitArray(windowSize);
            WithheldMessages = new NetIncomingMessage[windowSize];
        }
        public NetReliableSenderChannel(NetConnection connection, int windowSize)
        {
            LidgrenException.AssertIsPowerOfTwo((ulong)windowSize, nameof(windowSize));

            _connection    = connection;
            _windowSize    = windowSize;
            _windowStart   = 0;
            _sendStart     = 0;
            _receivedAcks  = new NetBitArray(NetConstants.SequenceNumbers);
            StoredMessages = new NetStoredReliableMessage[_windowSize];
            ResendDelay    = connection.ResendDelay;
        }
        public NetUnreliableSenderChannel(NetConnection connection, int windowSize, NetDeliveryMethod method)
        {
            LidgrenException.AssertIsPowerOfTwo((ulong)windowSize, nameof(windowSize));

            _connection   = connection;
            _windowSize   = windowSize;
            _windowStart  = 0;
            _sendStart    = 0;
            _receivedAcks = new NetBitArray(NetConstants.SequenceNumbers);

            _doFlowControl = true;
            if (method == NetDeliveryMethod.Unreliable &&
                connection.Peer.Configuration.SuppressUnreliableUnorderedAcks)
            {
                _doFlowControl = false;
            }
        }