[[File:loop-room-state.png|center|Room Session State Diagram]]
Note that there are some exceptional transitions that are not shown; in particular, a "session.connectionDestroyed" event from any of the "starting", "sending", "receiving", or "sendrecv" states will cause a transition to "waiting."
In order to run this state machine, the client must (in addition to the current state) keep track of three counters: