Skip to content

Commit

Permalink
Fix WebSocket communication (#591)
Browse files Browse the repository at this point in the history
* Fix WebSocket communication

* await on socket_tx sends
  • Loading branch information
niamu authored Dec 10, 2023
1 parent a36fabb commit 3a5f225
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dim-web/src/routes/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub async fn handle_websocket_session(
addr,
sink: Box::pin(sink),
auth: Box::new(u),
});
}).await;

let _ = socket_tx.send(CtrlEvent::SendTo {
addr,
Expand All @@ -151,7 +151,7 @@ pub async fn handle_websocket_session(
event_type: dim_events::PushEventType::EventAuthOk,
}
.to_string(),
});
}).await;

break 'auth_loop;
}
Expand All @@ -166,7 +166,7 @@ pub async fn handle_websocket_session(
event_type: dim_events::PushEventType::EventAuthErr,
}
.to_string(),
});
}).await;
}
}

Expand All @@ -178,7 +178,7 @@ pub async fn handle_websocket_session(
}

None = stream.next() => {
let _ = socket_tx.send(CtrlEvent::Forget { addr });
let _ = socket_tx.send(CtrlEvent::Forget { addr }).await;
break;
}
}
Expand Down

0 comments on commit 3a5f225

Please sign in to comment.