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.

Machine Statistics

Number of events:

4

Events not handled:

0

Events handled in one state:

4

At least one event handled the same in all states?

no

Number of states:

2

Number of states with entry functions:

0

Number of states with exit functions:

0

States handling no events:

0

States handling exactly one event:

1

States with no way in:

0

States with no way out:

0

State Chart

ESTABLISH_SESSION_REQUEST

STEP0_RESPONSE

STEP1_RESPONSE

MESSAGE_RECEIVED

IDLE

AWAITING_RESPONSE

sendStep1Message

transition: IDLE

parseMessage

Events

ESTABLISH_SESSION_REQUEST

This event is handled identically in 1 states.

These states handle this event:

This yields a state density of 50%.

These actions are taken in response to this event:

STEP0_RESPONSE

This event is handled identically in 1 states.

These states handle this event:

This yields a state density of 50%.

These actions are taken in response to this event:

STEP1_RESPONSE

This event is handled identically in 1 states.

These states handle this event:

This yields a state density of 50%.

These actions are taken in response to this event:

MESSAGE_RECEIVED

This event is shared from the parent machine.

This event is handled identically in 1 states.

These states handle this event:

This yields a state density of 50%.

These actions are taken in response to this event:

States

IDLE

These events are handled in this state:

This yields an event density of 25%.

These actions are taken in this state:

These states transition into this state:

This state transitions into these states:

AWAITING_RESPONSE

These events are handled in this state:

This yields an event density of 75%.

These actions are taken in this state:

These states transition into this state:

This state transitions into these states:

Actions

sendStep0Message

This action returns:

  • noEvent

sendStep1Message

This action returns:

  • noEvent

notifyParent

This action returns:

parseMessage

This action returns: