-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
client.connect() takes too long if server is unavailable... #1420
Comments
If have got a similar problem. Sometime the Client.connect() of a WIFISecureClient (Release 2.0.0) takes too long to return and causes a WDT reset. |
Hi...any solution for this? |
Hi...still waiting. Please help!!! |
connect() takes 5 seconds for me, but no WDT reset. |
Any update on this. This is becoming a blocker for applications that need to do other jobs when not connected to the server, something like saving state to eeprom. |
Please quantify "too long". Current behavior is to wait until either "connected" or "connection refused", but not more than 5 seconds. I can change this to the same timeout which is set using |
This should help. I mean any feature that allows the coder to manually set Please let up know what can be done for this. It's required urgently as Thanks Please quantify "too long". Current behavior is to wait until either — |
@igrr, Thanks for reply. That would help a bit but a better way would be to make it asynchronous and let the user monitor a status variable to check if the connection is successful. This way the code is non blocking and use cases where there are other tasks to perform while waiting for the connection can also be done. Ex.
|
@battuashwik If you need asynchronous operation, then you should probably use ESPAsyncTCP library. |
Completely missed this in the mentioned libraries. Thanks a lot for the help. |
Its great that now this is into consideration. Just wanted to know how can On Sat, May 14, 2016 at 11:30 AM, battuashwik notifications@github.com
|
@syalujjwal could you please clarify what are you referring to in your last question: ESPAsyncTCP library, or changing |
both are good enough solutions for me. I wish to use a library that allows On Mon, May 16, 2016 at 4:51 PM, Ivan Grokhotkov notifications@github.com
|
You can totally use ESPAsyncTCP library right now. |
so cool. Thank you :) On Mon, May 16, 2016 at 4:57 PM, Ivan Grokhotkov notifications@github.com
|
I have the same problem. I would be grateful for changing |
While I understand the 5 second behavior, I don't want an asyncronous library for my application. What would it take to get a the client.setTimeout function working as one would expect it to? |
If this was done in May, how can I update my Arduino IDE installation to include it? I seem to be stuck on 2.3, and I can see from viewing the source files that the client.connect does not use the timeout set by setTimeout, by comparing with the src from the repository. I tried the "staging" option, but that seemed to break everything again, and after a day of uninstalling, re-installing and rebooting, I'm loathe to try it again. I'm not stupid, I've been writing code for over 40 years, but I'm not au fait with all the Git stuff. |
Occasionally it happens that the
|
In case the server is unavailable, the client.connect() takes too long to return false and come out of the block. This takes 1.5 secs approx. which is too long for my project. Is there a way to solve this problem? Can there be a timeout set in case the client cannot connect within N milli secs?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: