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

ESP8266: prevent WOULD BLOCK from TX if UDP #9331

Merged
merged 2 commits into from
Jan 17, 2019
Merged

ESP8266: prevent WOULD BLOCK from TX if UDP #9331

merged 2 commits into from
Jan 17, 2019

Conversation

VeijoPesonen
Copy link
Contributor

@VeijoPesonen VeijoPesonen commented Jan 10, 2019

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

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@kjbracey-arm
@SeppoTakalo
@michalpasztamobica

Veijo Pesonen added 2 commits January 10, 2019 14:33
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.
@ciarmcom
Copy link
Member

@VeijoPesonen, thank you for your changes.
@SeppoTakalo @kjbracey-arm @michalpasztamobica @ARMmbed/mbed-os-ipcore @ARMmbed/mbed-os-maintainers please review.

@ciarmcom ciarmcom requested a review from a team January 10, 2019 13:07
_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;
Copy link
Contributor

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?

Copy link
Contributor

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.

@VeijoPesonen
Copy link
Contributor Author

@0xc0170 would you please review.

@cmonr
Copy link
Contributor

cmonr commented Jan 17, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Jan 17, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@0xc0170 0xc0170 changed the title ESP8266 - prevent WOULD BLOCK from TX if UDP ESP8266: prevent WOULD BLOCK from TX if UDP Jan 17, 2019
@0xc0170 0xc0170 merged commit b59b93e into ARMmbed:master Jan 17, 2019
@VeijoPesonen VeijoPesonen deleted the bugfix-esp8266_udp_prevent_would_block branch January 22, 2019 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants