Skip to content

Add connect timeout to WiFiClient #2383

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Feb 14, 2019
Merged

Add connect timeout to WiFiClient #2383

merged 2 commits into from
Feb 14, 2019

Conversation

boarchuz
Copy link
Contributor

Allows a timeout, in milliseconds, to be passed as an optional parameter to WiFiClient.connect().

Currently this is a blocking function which can take up to 20 seconds to return if the server isn't responding.

  • Incidentally, the 'normal' timeout will trigger an error at the usual time so behaviour is unchanged if a timeout isn't provided! (Unfortunately, it will also trigger if the provided timeout is longer; timeout duration is therefore effectively capped at whatever it is normally.) Ideally this would be overriden. Also, a defined default value might be more a better approach (see initial commit for eg.).

  • Perhaps using setTimeout would be a better way to set the value. That would leave signatures unchanged and only require setting the value once, instead of tacking it on to every connect().

@me-no-dev me-no-dev merged commit fc737e0 into espressif:master Feb 14, 2019
@me-no-dev
Copy link
Member

Nice! Thanks for adding this :)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants