Пример #1
0
        internal void ReceiveDataSyn(DataSyn      syn)
        {
            this.recv_queue.Write(syn);

            var data = this.recv_queue.Dequeue();

            this.OnData(Reactor.Buffer.Create(data));

            var ack = new DataAck(this.recv_queue.SequenceNumber, this.recv_queue.WindowSize);

            this.socket.Send(this.endpoint, ack.Serialize());
        }
Пример #2
0
        internal void ReceiveDataAck(DataAck       ack)
        {
            this.send_queue.Acknowledge(ack.AcknowledgementNumber);

            this.sending = false;

            foreach (var payload in this.send_queue.Read(1)) {

                this.socket.Send(this.endpoint, payload.Serialize());
            }
        }