コード例 #1
0
        private NorocPacket SendAck(NorocPacket msg, int timeout)
        {
            int length = msg.GetFullLength();
            byte[] buffer = new byte[NorocPacket.GetMaxSize()];

            connection.Send(msg.GetBytes(), msg.GetFullLength());
            buffer = Recv(timeout);

            if (buffer.Length <= 0)
                return null;

            return new NorocPacket(buffer);
        }
コード例 #2
0
        private NorocPacket SendResend(NorocPacket msg, UInt16 maxResend, int timeout)
        {
            int length = msg.GetFullLength();
            byte[] buffer = new byte[NorocPacket.GetMaxSize()];

            connection.Send(msg.GetBytes(),msg.GetFullLength());

            /* If we have data, or we have no tries left */
            for (int i = 0; i < maxResend || buffer.Length > 0; i++)
                buffer = Recv(timeout);

            if (buffer.Length <= 0)
                return null;

            return new NorocPacket(buffer);
        }
コード例 #3
0
 private void SendNoAck(NorocPacket msg)
 {
     connection.Send(msg.GetBytes(), msg.GetFullLength());
 }