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

negative send/receive deadlines do not work #198

Open
ahobsonsayers opened this issue May 11, 2020 · 1 comment
Open

negative send/receive deadlines do not work #198

ahobsonsayers opened this issue May 11, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ahobsonsayers
Copy link

If OptionRecvDeadline is set to a negative number on a sub socket (could apply to other protocols too, I did not test), calling the the Recv method will block until a data is received. According to the documentation, this should cause Recv to be a non-blocking operation.

@gdamore gdamore added the bug Something isn't working label Sep 27, 2020
@gdamore gdamore self-assigned this Sep 27, 2020
@gdamore
Copy link
Contributor

gdamore commented Sep 27, 2020

Its unusual to do this in Go, but it is a defect and not documented behavior.
Some of the protocols won't even let you set a negative deadline.

@gdamore gdamore changed the title Setting OptionRecvDeadline to a negative number blocks Recv() forever negative send/receive deadlines do not work Sep 27, 2020
gdamore added a commit that referenced this issue Sep 27, 2020
This actually affected pretty much all the protocols and both send
and receive deadlines.  While here we've also made sure that
a non-blocking check will not fail if a message can immediately
be sent or received.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants