-
Notifications
You must be signed in to change notification settings - Fork 87
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
uSockRead should return if a socket is closed by remote #168
Comments
Yes, I've wondered about capturing this and reporting it somehow, I will add it to the TODO list. |
(FYI, my current workaround is using small socket timeouts (using my own big one externally) + |
Hi Arnout: I've pushed a preview branch of the change here 4d29ef0. Is that the kind of change you were expecting? If so I'll push it to |
Hi, yup, sounds like what was missing, thanks! |
The fix is now pushed to |
Hi,
Just a comment on the workings of the function uSockRead.
If we set a read timeout of 10s
(uSockOptionSet(sock, U_SOCK_OPT_LEVEL_SOCK, U_SOCK_OPT_RCVTIMEO),
and poll uSockRead in a loop, we expected indeed after 10s of no data received, that the functions returns.However, if the socket is closed within that time, the module does report this:
But ubxlib does not use this information and keeps blocking for the timeout setting. (loop in
receive
function)Ideally, a posix socket would directly return in this case, indicating that the connection has closed.
It's possible to work around this behavior, but just letting it know that it is unexpected.
The text was updated successfully, but these errors were encountered: