digraph "Client Connection Flow" { node [shape=box]; graph [newrank=true]; start [label="Start"]; wait_hello [label="Wait for hello"]; new_session [label="New session"]; wait_ready [label="Wait for ready"]; connected [label="Connected"]; abort [label="Abort"]; lost_connection [label="Connection lost or\nunexpectedly closed\nwhile connecting" style="dotted"]; lost_connection -> start [label="Wait random delay"]; start -> wait_hello [label="Connect to /api/socket"]; wait_hello -> new_session [label="Receive hello"]; new_session -> wait_ready [label="Send register_*"]; wait_ready -> connected [label="Receive ready"]; wait_ready -> abort [label="Connection closed with 4003"]; }