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

How is it possible to check if a socket client is connected to the server on the server side #99

Open
hannescam opened this issue Jul 8, 2024 · 0 comments

Comments

@hannescam
Copy link

hannescam commented Jul 8, 2024

I want to find out if the current client is still connected to the server side (on the server side) but i couldn't find any way to do that
I found out that with this sketchy code it works in some cases :

result = socket.read(buffer, sizeof(buffer));

if (result.error().value() == 0 && result.value() == 0) {
  // Runs most of the time when the client disconnects
}

socket is a sockpp::tcp_socket

Thanks for the help in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant