-
Notifications
You must be signed in to change notification settings - Fork 3k
ESP8266: prevent WOULD BLOCK from TX if UDP #9331
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
ESP8266: prevent WOULD BLOCK from TX if UDP #9331
Conversation
With TCP it's desirable that SIGIO wakes up the application to check if there is buffer space space available on the mode. With UDP the behavior is not acceptable as we don't know if the other endpoint is there as connection establishment is missing. Hence buffers might stay full forever.
@VeijoPesonen, thank you for your changes. |
_global_event_queue->call_in(100, callback(this, &ESP8266Interface::event)); | ||
} else if (status == NSAPI_ERROR_WOULD_BLOCK && socket->proto == NSAPI_UDP) { | ||
status = NSAPI_ERROR_DEVICE_ERROR; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to modify the NSAPI_ERROR_WOULD_BLOCK to become NSAPI_ERROR_DEVICE_ERROR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think because UDP sending should never fail.
@0xc0170 would you please review. |
CI started |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Description
[ESP8266] Drop signalling SIGIO artificially if UDP send fails
With TCP it's desirable that SIGIO wakes up the application to check
if there is buffer space available on the mode. With UDP the
behavior is not acceptable as we don't know if the other endpoint is
there as connection establishment is missing. Hence buffers might
stay full forever.
Fix a debug print
Pull request type
Reviewers
@kjbracey-arm
@SeppoTakalo
@michalpasztamobica