Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ws): break loop after erasing client #30

Merged
merged 1 commit into from
Jan 28, 2025
Merged

Conversation

mathieucarbou
Copy link
Member

In relation to #29 and #28, I also found similar issue in WebSocket client cleanup code

@mathieucarbou mathieucarbou requested a review from a team January 28, 2025 20:00
@mathieucarbou mathieucarbou self-assigned this Jan 28, 2025
for (auto i = _clients.begin(); i != _clients.end(); ++i) {
if (i->shouldBeDeleted()) {
_clients.erase(i);
break;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: breaking is acceptable - no need to continue the loop because the client cleanup function, as per the doc, has to be called frequently from main loop.

so eventually clients will be cleened up.

@mathieucarbou mathieucarbou merged commit 9bdefb8 into main Jan 28, 2025
22 checks passed
@mathieucarbou mathieucarbou deleted the issues/ws-cleanup branch January 28, 2025 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants