Skip to content

Allow setting TCP timeout #1312

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

Merged
merged 2 commits into from
Dec 27, 2015
Merged

Allow setting TCP timeout #1312

merged 2 commits into from
Dec 27, 2015

Conversation

denvera
Copy link
Contributor

@denvera denvera commented Dec 27, 2015

Added method to set TCP timeout for connect on HTTP requests. Not sure if its worth allowing this to be set at runtime though, but it was useful in one of my own projects.

* @param timeout unsigned int
*/
void HTTPClient::setTimeout(uint16_t timeout) {
_tcpTimeout = timeout;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may add:

if(connected()) {
 _tcp->setTimeout(timeout);
}

to allow changing timeout when the connection is already there

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea, thank you for that. I've added in your check.

Links2004 added a commit that referenced this pull request Dec 27, 2015
Allow setting TCP timeout
@Links2004 Links2004 merged commit 304bf08 into esp8266:master Dec 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants