Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

investigate non blocking connect #29

Open
proppy opened this issue Dec 29, 2015 · 8 comments
Open

investigate non blocking connect #29

proppy opened this issue Dec 29, 2015 · 8 comments
Milestone

Comments

@proppy
Copy link
Contributor

proppy commented Dec 29, 2015

apparently lwip support it: https://github.com/goertzenator/lwip/blob/master/contrib-1.4.0/apps/socket_examples/socket_examples.c#L25

@proppy
Copy link
Contributor Author

proppy commented Dec 29, 2015

A non blocking implementation would add a new connect_async function or a flag with a different callback and no yield/schedule call.

And the http connect version could return early rather than erroring:
https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp#L670-L673

@Links2004
Copy link

the HTTP client changes are more complex then just return.
connect is never called form outside the class:
https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.h#L192

its only called in sendRequest
https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp#L298

the connect shut be fast if the server is there,
only when there is no server it can block for a longer time until:
https://github.com/esp8266/Arduino/blob/342c4ae6fb847bfc787f80b89a2bb888d942dc32/libraries/ESP8266WiFi/src/WiFiClient.cpp#L149
is called.

@proppy
Copy link
Contributor Author

proppy commented Dec 30, 2015

@Links2004 yes, I was planning to investigate exposing connect with #28

@proppy
Copy link
Contributor Author

proppy commented Jun 25, 2016

@proppy
Copy link
Contributor Author

proppy commented Jun 25, 2018

Note that this would be affected by #353.

@proppy proppy added this to the 0.3 milestone Jun 25, 2018
@yhua537
Copy link

yhua537 commented Aug 16, 2018

Like the idea using ESPAsyncTCP(as I am using it for other connections), can I suggest use injection to allow us choosing which type of connection to use?

Also, should the scope of this library to a easier use of firebase API?

@kiralikbeyin
Copy link

#420 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants