示例#1
0
文件: DLL.cs 项目: KRNet/krnet
 private void sendRetryFrame()
 {
     Frame retFrame = new Frame(new byte[0], Data.RETFrame);
     stopSendingFrames();
     Console.WriteLine("Sending RET...");
     physicalLayer.sendFrame(retFrame.serialize());
     continueSendingFrames();
 }
示例#2
0
文件: DLL.cs 项目: KRNet/krnet
 private void sendLinkAckFrame()
 {
     Frame LinkACKFrame = new Frame(new byte[0], Data.LINK_ACKFrame);
     while (!canSend) { }
     stopSendingFrames();
     Console.WriteLine("Sending LINK_ACK...");
     physicalLayer.sendFrame(LinkACKFrame.serialize());
     continueSendingFrames();
 }
示例#3
0
文件: DLL.cs 项目: KRNet/krnet
        private void sendLinkFrame()
        {
            while (true)
            {
                if (physicalLayer.connectionActive)
                {
                    if (linkFramesSended >= 3)
                    {
                        linkStatus = false;
                        return;
                    }
                    else
                    {
                        if (canSend)
                        {
                            Frame LinkFrame = new Frame(new byte[0], Data.LINKFrame);

                            stopSendingFrames();
                            Console.WriteLine("Sending LINK...");
                            physicalLayer.sendFrame(LinkFrame.serialize());
                            continueSendingFrames();

                            linkFramesSended += 1;
                        }

                    }

                }
                Thread.Sleep(Data.LinkFrameTimeout);
            }
        }
示例#4
0
文件: DLL.cs 项目: KRNet/krnet
        //Обработка информационного кадра
        private void processInfoFrame(Frame frame)
        {
            Frame ackFrame = new Frame(new byte[0], Data.ACKFrame);

                Console.WriteLine(getString(frame.getData()));

                stopSendingFrames();
                Console.WriteLine("Sending ACK...");
                physicalLayer.sendFrame(ackFrame.serialize());
                continueSendingFrames();

                this.stringsBuffer.Enqueue(getString(frame.getData()));
        }