@startuml

[*] -down-> NOT_CONNECTED

NOT_CONNECTED -down-> CONNECT_REQUESTED : CONNECT
NOT_CONNECTED -right-> NOT_CONNECTED : OFFER

CONNECT_REQUESTED -down-> CONNECTED : ACK
CONNECT_REQUESTED -right-> WAIT_FOR_OFFER : NACK
CONNECT_REQUESTED : entry / CONNECT with response queue for server

WAIT_FOR_OFFER -left-> CONNECT_REQUESTED : OFFER
WAIT_FOR_OFFER -up-> NOT_CONNECTED : DISCONNECT

CONNECTED -up-> WAIT_FOR_OFFER : STOP_OFFER
CONNECTED -up-> DISCONNECT_REQUESTED : DISCONNECT
CONNECTED : entry / store received request queue
CONNECTED : exit / remove request queue

DISCONNECT_REQUESTED -up-> NOT_CONNECTED : ACK/NACK
DISCONNECT_REQUESTED : entry / DISCONNECT with response queue for server

@enduml
