---
description: >-
  Optional reading to better understand the management of the websocket
  connection
---

# 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" %}

