You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
how it's possible to send message to specific connection_id or token?
similar to broadcast but array of users, actually i need to send multicast message
The text was updated successfully, but these errors were encountered:
Maybe you could do something like this? Not sure if it's the best way...
To send a message to a connection, you'd use the Sender object.
So if you want to send by some kind of token, you need to associate those to Senders, e.g.
let mut user_connections: RwLock<HashMap<UserId, Rc<ws::Sender>>> = RwLock::new(HashMap::new());
Where I've added the Mutex because this structure is writable by multiple connections. Maybe your architecture has a way around it, or you have a better datastructure.
how it's possible to send message to specific connection_id or token?
similar to broadcast but array of users, actually i need to send multicast message
The text was updated successfully, but these errors were encountered: