コード例 #1
0
        private void SendAcknowledgedCommand(Packet request)
        {
            if (transmitter == null)
            {
                throw new InvalidOperationException();
            }

            var answerCommand = Command.ReplyNegativeAcknowledge;

            do
            {
                if (answerCommand == Command.ReplyNegativeAcknowledge)
                {
                    transmitter.DiscardPendingPackets();
                    transmitter.SendPacket(request);
                }
                answerCommand = transmitter.ReceivePacket(TimeSpan.FromSeconds(3)).Command;
            }while (answerCommand != Command.ReplyAcknowledge);
        }