hsmCommunicator::establishSession

Establish a connection with the peer.

Two messages must be exchanged with the peer to successfully establish the session. The machine needs only two states, IDLE and AWAITING_RESPONSE since the top level machine tracks whether or not it is in a session. The AWAITING_RESPONSE state serves for both required messages, since the receipt of each message produces a unique event.

When the STEP1_RESPONSE event is received, the session is considered established. This machine will then return the parent's SESSION_ESTABLISHED message and move to its IDLE state.

Number of events4
Events not handled0
Events handled in one state4
At least one event handled the same in all states?no
Number of states2
Number of states with entry functions0
Number of states with exit functions0
States handling no events0
States handling exactly one event1
States with no way in0
States with no way out0
  ESTABLISH_SESSION_REQUEST STEP0_RESPONSE STEP1_RESPONSE (hsmCommunicator::) MESSAGE_RECEIVED
IDLE sendStep0Message
returns:
  • noEvent

transition : AWAITING_RESPONSE

Start the session establishment process.


transition : none

transition : none

transition : none
AWAITING_RESPONSE
transition : none
sendStep1Message
returns:
  • noEvent

transition : none

Continue session establisment

notifyParent
returns:
  • hsmCommunicator::SESSION_ESTABLISHED

transition : IDLE

Notify parent that session is established.

parseMessage
returns:
  • STEP0_RESPONSE
  • STEP1_RESPONSE
  • noEvent

transition : none

Parse the incoming message

Events
Total number of events:4
Events with no handlers:0
Events with one handler:4
Average event state density:50%
ESTABLISH_SESSION_REQUEST

Handled In 1 of 2 (50 %) States:

  • IDLE

Causes these actions to be taken:

  • sendStep0Message
STEP0_RESPONSE

Handled In 1 of 2 (50 %) States:

  • AWAITING_RESPONSE

Causes these actions to be taken:

  • sendStep1Message
STEP1_RESPONSE

Handled In 1 of 2 (50 %) States:

  • AWAITING_RESPONSE

Causes these actions to be taken:

  • notifyParent
(hsmCommunicator::) MESSAGE_RECEIVED

Handled In 1 of 2 (50 %) States:

  • AWAITING_RESPONSE

Causes these actions to be taken:

  • parseMessage
States
Total number of states:2
States with no events:0
States with one event:1
States with no way in:0
States with no way out:0
Average state event density:50%
IDLE

Inbound Transitions:

  • AWAITING_RESPONSE

Outbound Transitions:

  • AWAITING_RESPONSE

Events Handled (1 of 4 for 25%):

  • ESTABLISH_SESSION_REQUEST

Actions Taken:

  • sendStep0Message
AWAITING_RESPONSE

Inbound Transitions:

  • IDLE

Outbound Transitions:

  • IDLE

Events Handled (3 of 4 for 75%):

  • STEP0_RESPONSE
  • STEP1_RESPONSE
  • MESSAGE_RECEIVED

Actions Taken:

  • sendStep1Message
  • notifyParent
  • parseMessage
Actions
sendStep0Message

Returns:
  • noEvent

Matrices:

  • ESTABLISH_SESSION_REQUEST, IDLE transitions to state AWAITING_RESPONSE
sendStep1Message

Returns:
  • noEvent

Matrices:

  • STEP0_RESPONSE, AWAITING_RESPONSE
notifyParent

Returns:
  • hsmCommunicator::SESSION_ESTABLISHED

Matrices:

  • STEP1_RESPONSE, AWAITING_RESPONSE transitions to state IDLE
parseMessage

Handles an event shared from hsmCommunicator



Returns:
  • STEP0_RESPONSE
  • STEP1_RESPONSE
  • noEvent

Matrices:

  • MESSAGE_RECEIVED, AWAITING_RESPONSE