handle_socket

Function handle_socket 

Source
async fn handle_socket(socket: WebSocket, state: Arc<WebSocketState>)
Expand description

Handles a single WebSocket connection.

This asynchronous function manages sending messages from a broadcast channel to the client and handles incoming messages from the client (e.g., pings, close).

ยงArguments

  • socket - The established WebSocket connection.
  • state - The shared WebSocketState.