> For the complete documentation index, see [llms.txt](https://navana.gitbook.io/bodhi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://navana.gitbook.io/bodhi/quickstart/streaming-websocket/connection-lifecycle.md).

# Connection Lifecycle

### Lifecycle Diagram

{% @mermaid/diagram content="sequenceDiagram
participant Client
participant Server

```
Client->>Server: Connect (WebSocket)

rect rgb(245, 245, 245)
note over Client,Server: Streaming Phase

Client-->>Server: Binary Audio Chunk #1
Server-->>Client: Partial Transcript (Segment 1)
Client-->>Server: Binary Audio Chunk #2
Server-->>Client: Complete Transcript (Segment 1)
Client-->>Server: Binary Audio Chunk #3
Server-->>Client: Complete Transcript (Segment 2)
Client-->>Server: Binary Audio Chunk #4
Server-->>Client: Complete Transcript (Segment 2)
end

Client-->>Server: End of Stream (EOS)
Server-->>Client: Complete Transcript (Segment 3)
Client-->>Server: Close Connection
" fullWidth="false" %}
```
