Пример #1
0
        //	This is the function that will check for default transitions if
        //  no other transitions were satisfied.
        //
        public override bool defaultTransitions(InternalEvent ie)
        {
            bool done = false;

            // Since this function can be called from multiple threads,
            // we use a mutex to ensure only one state transition is
            // active at a time.
            mutex.WaitOne();

            // Invoke the FSM transition for this event.
            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("PingServer_PingFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive)ie;
                    int     pos       = 0;
                    ushort  id        = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if (id == new QueryHeartbeatPulse().getID())
                    {
                        QueryHeartbeatPulse msg = new QueryHeartbeatPulse();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pPingServer_PingFSM.context.QueryHeartbeatPulseTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}



            mutex.ReleaseMutex();
            return(done);
        }
Пример #2
0
        //    This is the function that will process an event either generated
        //  by the service, sent to it by another service on the same component,
        //  or as a message sent by a different component.
        public override bool processTransitions(InternalEvent ie)
        {
            bool done = false;

               // Since this function can be called from multiple threads,
               // we use a mutex to ensure only one state transition is
               // active at a time.
               mutex.WaitOne();

                // Invoke the FSM transition for this event.
            try
            {
                if (ie.getName().CompareTo("Receive") == 0 && (ie.getSource().CompareTo("PingServer_PingFSM") != 0) && (!done))
                {
                    Receive casted_ie = (Receive) ie;
                    int pos = 0;
                    ushort id = BitConverter.ToUInt16(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                    if ( id == new QueryHeartbeatPulse().getID())
                    {
                        QueryHeartbeatPulse msg = new QueryHeartbeatPulse();
                        msg.decode(casted_ie.getBody().getReceiveRec().getMessagePayload().getData(), pos);
                        pPingServer_PingFSM.context.QueryHeartbeatPulseTransition();
                        done = true;
                    }
                }
            } catch (Exception e) {}

            mutex.ReleaseMutex();
            return done;
        }
Пример #3
0
        public QueryHeartbeatPulse(QueryHeartbeatPulse value)
        {
            /// Initiliaze the protected variables
            m_AppHeader = new AppHeader();
            m_IsCommand = false;

            /// Copy the values
            m_AppHeader = value.m_AppHeader;
        }
Пример #4
0
        public QueryHeartbeatPulse(QueryHeartbeatPulse value)
        {
            /// Initiliaze the protected variables
            m_AppHeader = new AppHeader();
            m_IsCommand = false;

            /// Copy the values
            m_AppHeader = value.m_AppHeader;
        }
Пример #5
0
        public bool  isEqual(QueryHeartbeatPulse value)
        {
            if (!this.getAppHeader().isEqual(value.getAppHeader()))
            {
                return(false);
            }

            return(true);
        }
Пример #6
0
        public bool isEqual(QueryHeartbeatPulse value)
        {
            if (!this.getAppHeader().isEqual(value.getAppHeader()))
            {
            return false;
            }

            return true;
        }
Пример #7
0
        public QueryHeartbeatPulse setAs(QueryHeartbeatPulse value)
        {
            m_AppHeader = value.m_AppHeader;

            return this;
        }
Пример #8
0
 public bool notEquals(QueryHeartbeatPulse value)
 {
     return !this.isEqual(value);
 }
Пример #9
0
 public bool  notEquals(QueryHeartbeatPulse value)
 {
     return(!this.isEqual(value));
 }
Пример #10
0
        public QueryHeartbeatPulse setAs(QueryHeartbeatPulse value)
        {
            m_AppHeader = value.m_AppHeader;

            return(this);
        }