websocket-manager
websocket-manager copied to clipboard
Chat Rooms
Hi, one question... Can I manage a Chat Room with this library? Is possible? Thanks!
Hi!
At this moment it is not possible, you would need something like groups, which are not implemented right now. If you are interested in contributing, we can surely work together on this feature.
Thanks!
Thanks @radu-matei I will try to work on it... ;)
Let's keep this open and discuss what you would like to implement here :)
Do you have something specific in mind to start with?
Hi @radu-matei, not in this moment... We are migrating our App to ASP.NET Core, and in this moment we are researching about all our requirements... ;)
Ok, then what would you need specifically from the library?
One functionality in particular we need is ability to filter the message based on parameter to different clients. For ex:
- Assume multiple clients are connected which belong to different ogranization, they pass orgid when they registerfor websocket message.
- Only messages which are sent for an organization should be sent to the client which are registered based on the orgid
Is this possible ? Thx
Regards Satya
I created a pull request that should allow for filtering connections based on anything. Find it here: https://github.com/radu-matei/websocket-manager/pull/32/commits
It also allows for adding properties and speeds up sending messages.
Hello! I will try to implement chat rooms, any ideas about how should it be?? I thought of a concurrent dictionary. The dictionary would have the ID of the chat room as the key and a list of connection IDs.
Hi,
Should we instantiate one SocketManager per room, so each room has its own _sockets Dictionary? Are we having one SocketManager during application lifetime? Are we having one SocketHandler per client request?
Hi @dotrung! answering you questions 1.- No, you only need one SocketManager. 2.- You should have just one during life time. 3.- AFAIK, no, you only have one socket handler that will be instantiated by the middleware.
Hi @miker1423
- Does it have affect to the scalability?
- After reading the issues/39, I though we only have one SocketManager for application lifetime. Actually we have multiple SocketManager, one per SocketHandler, which in turn has application lifetime. Thus, SocketManager has application lifetime.
- Is this issue solved? I see the middleware has
Group
feature. - Should an endpoint a group? Sockets are being grouped by endpoint, and then in each group, they splitted into smaller groups.