コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="connection"></param>
        /// <param name="ackTimeout">how long after last send before sending empty ack</param>
        /// <param name="time"></param>
        public AckSystem(IRawConnection connection, Config config, int maxPacketSize, ITime time, Pool <ByteBuffer> bufferPool, Metrics metrics = null)
        {
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            _connection   = connection;
            _time         = time;
            _bufferPool   = bufferPool;
            _reliablePool = new Pool <ReliablePacket>(ReliablePacket.CreateNew, default, 0, config.MaxReliablePacketsInSendBufferPerConnection);
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="connection"></param>
        /// <param name="ackTimeout">how long after last send before sending empty ack</param>
        /// <param name="time"></param>
        public AckSystem(IRawConnection connection, float ackTimeout, Time time)
        {
            this.connection = connection;
            this.time       = time;
            this.ackTimeout = ackTimeout;

            // set received to first sequence
            // this means that it will always be 1 before first sent packet
            // so first receieved will have correcct distance
            receivedSequence = (ushort)sequencer.Next();

            SetSendTime();
        }
コード例 #3
0
ファイル: NotifySystem.cs プロジェクト: unitycoder/Mirage
        /// <summary>
        ///
        /// </summary>
        /// <param name="connection"></param>
        /// <param name="ackTimeout">how long after last send before sending empty ack, see <see cref="AckSystem.AckSystem(IRawConnection, float, Time)"/></param>
        /// <param name="time"></param>

        public NotifySystem(IRawConnection connection, float ackTimeout, Time time)
        {
            ackSystem = new AckSystem(connection, ackTimeout, time);
        }