Skip to content

Best way of handling Websocket "rooms" and responding to multiple clients #308

Discussion options

You must be logged in to vote

Hi, finally the first topic in the discussions channel! 🙃

The framework by design doesn't handle any form of channel/room support. It is up to the developer to implement this or reuse an existing solution (available somewhere? 🙈 ). If I would like to face this problem I would start with some code-responsibility detection.

  1. You can reuse the DI mechanism and define a dependency/reader that will manage all incoming/outgoing and existing connections, eg. it doesn't mean that you have to store them explicitly - it is already managed by an instance of WebSocketServerConnection which is just an extension of ws WebSocket.Server interface. See docs. Each stored client has its own id property, ad…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@the-kwisatz-haderach
Comment options

Answer selected by the-kwisatz-haderach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants