Skip to content
Discussion options

You must be logged in to vote

If you want to get the number of sockets for this namespace variant:

let _ = io.dyn_ns("/{client_id}", |s:SocketRef,io:SocketIo| asyncmove{let namespace_size = io.of(s.ns()).unwrap().sockets().unwrap().len();// this should work});

But if you want all the sockets of all the namespaces variants corresponding to this dynamic namespace, you can't. Currently dynamic namespace features are quite limited. It will be added to the roadmap though.

It is a bit hacky but can maintain an external counter or a set of the created namespaces and fetch + sum the number of sockets for each namespace.

Btw you can use SocketIo as a param extractor rather than cloning it:

let _ = io.dyn_ns("/{cl…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@govijr
Comment options

Answer selected bygovijr
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@govijr@Totodore