// 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); }
// 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; }
public QueryHeartbeatPulse(QueryHeartbeatPulse value) { /// Initiliaze the protected variables m_AppHeader = new AppHeader(); m_IsCommand = false; /// Copy the values m_AppHeader = value.m_AppHeader; }
public bool isEqual(QueryHeartbeatPulse value) { if (!this.getAppHeader().isEqual(value.getAppHeader())) { return(false); } return(true); }
public bool isEqual(QueryHeartbeatPulse value) { if (!this.getAppHeader().isEqual(value.getAppHeader())) { return false; } return true; }
public QueryHeartbeatPulse setAs(QueryHeartbeatPulse value) { m_AppHeader = value.m_AppHeader; return this; }
public bool notEquals(QueryHeartbeatPulse value) { return !this.isEqual(value); }
public bool notEquals(QueryHeartbeatPulse value) { return(!this.isEqual(value)); }
public QueryHeartbeatPulse setAs(QueryHeartbeatPulse value) { m_AppHeader = value.m_AppHeader; return(this); }