-
Notifications
You must be signed in to change notification settings - Fork 13.3k
client.connected() return true when internet lost connection #8327
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
This is not related to Core though? Example code you provided deals with PubSubClient, which is an external library and is not maintained in this repo. Check out the example code dealing with disconnections, and if that does not work please report to the PubSubClient repo instead: |
@mcspr i checked pubsubclient.cpp, in function client.connected() they call core 's function: when lost connection (i unplug the network) -> function 's esp8266 (_client->connected) not return false state instantly |
Yes, but this does not happen immediately
Arduino/libraries/ESP8266WiFi/src/WiFiClient.cpp Lines 325 to 331 in 9d024d1
|
@mcspr Thank for support!! |
Regarding
While it is true that historically, Currently |
Then, should the notice be in the our client doc? 'git-blame' points to #4626, and there was at least one discussion related to the change at #6701 (which did not actually result in updating the docs... :/) Something like
And replace the 'connected()' link with a html header link to the paragraph included in the wificlient class page Also from cross-links, there's at least one patch to the pubsubclient that tweaks it's behaviour and uses ::available() before ::connected() |
----------------------------- Delete below -----------------------------
If your issue is a general question, starts similar to "How do I..", is related to 3rd party libs, or is related to hardware, please discuss at a community forum like esp8266.com.
INSTRUCTIONS
If you do not follow these instructions, your issue may be dismissed.
https://arduino-esp8266.readthedocs.io/en/latest/Troubleshooting/stack_dump.html
https://arduino-esp8266.readthedocs.io/en/latest/Troubleshooting/debugging.html
----------------------------- Delete above -----------------------------
Basic Infos
Platform
Settings in IDE
Problem Description
Detailed problem description goes here.
MCVE Sketch
Debug Messages
When internet lost connection client.connected() return true so I continue to publish -> Error
The text was updated successfully, but these errors were encountered: