Пример #1
0
            public void Run()
            {
                if (initialized == false)
                {
                    linkLayer = new LinkLayer(buffer, linkLayerParameters, transceiver, DebugLog);
                    linkLayer.LinkLayerMode = linkLayerMode;

                    if (linkLayerMode == LinkLayerMode.BALANCED)
                    {
                        linkLayer.SetPrimaryLinkLayer(new PrimaryLinkLayerBalanced(linkLayer, GetUserData, DebugLog));
                        linkLayer.SetSecondaryLinkLayer(new SecondaryLinkLayerBalanced(linkLayer, linkLayerAddress, HandleApplicationLayer, DebugLog));
                    }
                    else
                    {
                        linkLayer.SetSecondaryLinkLayer(new SecondaryLinkLayerUnbalanced(linkLayer, linkLayerAddress, this, DebugLog));
                    }

                    initialized = true;
                }

                if (fileServer != null)
                {
                    fileServer.HandleFileTransmission();
                }

                linkLayer.Run();
            }
Пример #2
0
        /// <summary>
        /// Run the protocol state machines a single time.
        /// Alternative to Start/Stop when no background thread should be used
        /// Has to be called frequently
        /// </summary>
        public void Run()
        {
            linkLayer.Run();

            if (fileClient != null)
            {
                fileClient.HandleFileService();
            }
        }
Пример #3
0
        /// <summary>
        /// Run the protocol state machines a single time.
        /// Alternative to Start/Stop when no background thread should be used
        /// Has to be called frequently
        /// </summary>
        public void Run()
        {
            if (fatalError == false)
            {
                linkLayer.Run();

                if (fileClient != null)
                {
                    fileClient.HandleFileService();
                }
            }
        }
Пример #4
0
        /// <summary>
        /// Run the protocol state machines a single time.
        /// Alternative to Start/Stop when no background thread should be used
        /// Has to be called frequently
        /// </summary>
        public void Run()
        {
            if (port != null)
            {
                if (port.IsOpen == false)
                {
                    port.Open();
                }

                port.DiscardInBuffer();
            }

            linkLayer.Run();

            if (fileClient != null)
            {
                fileClient.HandleFileService();
            }
        }