Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feature Request: Built-in method to list all connected sockets #544

dDeepLb started this conversation in Ideas
Feature Request: Built-in method to list all connected sockets #544
Jul 18, 2025 * 1 comments * 1 reply
Return to top
Discussion options

dDeepLb
Jul 18, 2025

Hi, thanks for the awesome work on socketioxide!

I'd like to propose a feature: a built-in method to retrieve all currently connected sockets for a namespace (or globally).
This would simplify managing server state for broadcasting, inspecting socket info, etc.

Currently, the only way to do this is to manually track sockets like in a HashMap or smth during connection and disconnection events, which is error-prone and adds boilerplate.

Example API (hypothetical):

io.connected_sockets("/") -> Vec<SocketRef>
You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

Totodore
Jul 18, 2025
Maintainer

Did you consider SocketIo::sockets? You can then filter it with SocketRef::connected

You must be logged in to vote
1 reply
Comment options

dDeepLb Jul 18, 2025
Author

Oh, I was looking around and didn't find such a treasure. Thanks a lot!
But still if it's not hard, it would be nice to have function around to get all the connected sockets without all of this dance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants