-
Notifications
You must be signed in to change notification settings - Fork 7.6k
WiFiClient.cpp::setTimeout not working properly? #2016
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
Comments
My fault: i set the client.setTimeout command at wrong place before opening the stream. |
I was wrong, code placement seems not to be the error cause. |
As I understand it, the timeout is not used for the connection, but for reading and writing only. So you should use client.setTimeout() after client.connect(). I may have found the error code here, though: http://www.nongnu.org/lwip/2_0_x/group__infrastructure__errors.html Beware, the timeout for WiFiClient (ie effectively what is called using WiFiClientSecure.setTimeout()) is not passed on to Stream, causing timeout errors while reading. See my comments at PR #1979. |
You're welcome :), you can use this PR by checking it out locally on your computer |
Did that already. But my goal is not to keep a local update.cpp at all... |
Sure, that is why I want it to be merged soon too! |
int connect(IPAddress ip, uint16_t port, int32_t timeout); |
I'm trying to set a connection timeout before opening a wifi connection.
My code is:
This openes the wifi connection successful, but it logs this error:
[E][WiFiClient.cpp:236] setSocketOption(): 1006 : 9
0x1006 is defined as
#define SO_RCVTIMEO 0x1006 /* receive timeout */
but what means error 9 ?
The text was updated successfully, but these errors were encountered: