Пример #1
0
        public ComponentState GetComponentState(byte netIfIndex)
        {
            LinkDriver p = GetLinkDriver(netIfIndex);

            if (p != null)
            {
                return(p.GetComponentState());
            }
            return(ComponentState.Problem);
        }
Пример #2
0
        // Returns true if message sent successfully.
        // Returns false if low level write Q count above water mark.
        // If connection dies during a long xfer, abort & return false.
        public bool DispatchMessage(MessageBinder binder)
        {
            if (PostNetIfIndex == ProtocolConstants.NETIF_UNSET)
            {
                OutgoingNetIfIndex = ProtocolConstants.NETIF_USER_BASE;
            }
            else
            {
                OutgoingNetIfIndex = PostNetIfIndex;
            }
            LinkDriver p = Exchange.Manager.GetLinkDriver(OutgoingNetIfIndex);

            if (p == null)
            {
                LastError = MessageError.BadNetIf;
                return(false);
            }
            if (p.GetWriteQueueSize() > p.LinkWriteQWaterMark)
            {
                return(false);
            }
            if (p.GetComponentState() != ComponentState.Working)
            {
                return(false);
            }

            if (binder.Message.SenderId != 0)
            {
                binder.Exchange.SubmitWaiter(binder);
            }
            while (HasRemainingTransfers())
            {
                ;
            }
            return(true);
        }