async fn handle_socket(socket: WebSocket, rooms: Arc<RwLock<AppState>>)
Expand description

Handles the WebSocket connection.

This function splits the WebSocket into a sender and receiver, creates a client, and handles the messages received from the client. It also handles the close event from the client.

§Arguments

  • socket - The WebSocket connection.
  • rooms - The shared state of the server.