Esempio n. 1
0
        public bool MatchRegistered(object[] MatchArgs, AckMessage.StatusType status, object data, AckMessage OrigAck)
        {
            bool Sent = false;

            foreach (RegisteredMessage RegMsg in RegisteredMessages)
            {
                if (RegMsg.Matches(MatchArgs))
                {
                    // we send an EventMessage based on this match using the args provided.
                    AckMessage ack;
                    ack             = new AckMessage(status, data, (CommandMessage)RegMsg);
                    ack.MatchParams = MatchArgs;
                    if (null != OrigAck)
                    {
                        if (RegMsg.sender == OrigAck.sender)// really next a Next type jump.
                        {
                            goto End;
                        }
                        ack.sender = OrigAck.sender; // override source.
                    }
                    Sent |= Send(ack);
End:
                    // stupid labels must come before code.
                    int x = 1;
                    x    += 1;
                }
            }
            return(Sent);
        }
Esempio n. 2
0
        public bool Ack(CommandMessage msg, AckMessage.StatusType status, object args)
        {
            AckMessage ack = msg.AckCommand(status, args);

            // signal with the ManualResetEvent before sending the ack just in case.
            if (null != msg.StatusChanged)
            {
                msg.StatusChanged.Set();
            }
            return(Send(ack));
        }
Esempio n. 3
0
        public AckMessage AckCommand(AckMessage.StatusType status, object args)
        {
            if (StatusChanged != null)
            {
                StatusChanged.Set();
            }
            if (!WantAck)
            {
                return(null);
            }
            AckMessage ack = new AckMessage(status, args, this);

            return(ack);
        }
Esempio n. 4
0
        public AckMessage AckCommand(AckMessage.StatusType status, string msg)
        {
            if (StatusChanged != null)
            {
                StatusChanged.Set();
            }
            if (!WantAck)
            {
                return(null);
            }
            AckMessage ack = new AckMessage(status, msg, this);

            return(ack);
        }