Ejemplo n.º 1
0
        Datagram CreateSpecialDatagram(MessageType messageType)
        {
            var datagram = Datagram.CreateEmpty(peer.Configuration.MemoryStreamPool);

            datagram.Type = messageType;
            return(datagram);
        }
Ejemplo n.º 2
0
        void SendPing()
        {
            lastPingSequence = (ushort)((lastPingSequence + 1) % ChannelBase.MAX_SEQUENCE);
            var pingDatagram = Datagram.CreateEmpty(peer.Configuration.MemoryStreamPool);

            pingDatagram.Type     = MessageType.Ping;
            pingDatagram.Sequence = lastPingSequence;
            lastPingSent          = DateTime.UtcNow;
            SendDatagramAsync(pingDatagram);
        }