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

nall: correctly handle TCP peer disconnections in tcp-socket.cpp #1365

Merged
merged 2 commits into from
Jan 18, 2024

Conversation

rasky
Copy link
Collaborator

@rasky rasky commented Jan 17, 2024

Currently, when a client disconnects, the server in Ares fails to notice and to call the onDisconnect hook, which in turns cause the server to stop responding (it won't accept a new client, and will never receive more data from the disconnected one).

This commit fixes it by correctly handling the recv() return code to detect peer disconnections (return value 0) and any other kind of error (return value < 0).

rasky added 2 commits January 17, 2024 10:44
Currently, when a client disconnects, the server in Ares fails to
notice and to call the onDisconnect hook, which in turns cause the
server to stop responding (it won't accept a new client, and will
never receive more data from the disconnected one).

This commit fixes it by correctly handling the recv() return code
to detect peer disconnections (return value 0) and any other kind
of error (return value < 0).
@LukeUsher LukeUsher merged commit 322c99c into ares-emulator:master Jan 18, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants