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

Non-Blocking TcpSocket doesn't handle partial sends properly #749

binary1248 opened this Issue Dec 10, 2014 · 0 comments


None yet
2 participants

binary1248 commented Dec 10, 2014

When sending a lot of data (or if just unlucky) over a non-blocking TCP connection, calls to send() can return with sf::Socket::NotReady even if a part of the passed data block was indeed sent.

This happens because the for loop that takes care of partial sends in blocking mode terminates prematurely due to -1 being returned with EWOULDBLOCK as is standard with non-blocking sockets.

Since the partial send size is not relayed back to the user, there is no way for them to resume sending where the previous attempt stopped due to not being ready.

This affects sending sf::Packets as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment