leftovers

This commit is contained in:
Adam 2024-07-27 02:57:55 -04:00
parent 22af4d94d6
commit b653687c81

View file

@ -28,11 +28,11 @@ fn server_sum_update(state: &Arc<AppState>) -> ServerStateSummary {
}
pub async fn on_websocket_connection(stream: WebSocket, state: Arc<AppState>, addr: SocketAddr) {
// Add User to users
let new_user = User {
name: "Anonymous".to_string(),
};
let res = state.users.lock().unwrap().insert(addr.clone(), new_user);
tracing::debug!("{:#?}", res);
state.users.lock().unwrap().insert(addr, new_user);
// By splitting, we can send and receive at the same time.
let (mut sender, mut receiver) = stream.split();