-
Notifications
You must be signed in to change notification settings - Fork 48
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
SSLClient::connected "Socket was dropped unexpectedly" because m_client is done but SSLClient still has data in buffer #43
Comments
Could someone from the project team confirm this issue? I have the same stack as @JAndrassy and I am seeing the same behavior. |
I haven't had this issue myself but the explanation makes sense. Unfortunately I don't have the bandwidth to try and implement a solution at the moment, but I'd be happy to review any PRs that people submit. |
just add
at the beginning of |
@JAndrassy I generally trust your expertise a lot more than I trust mine wrt to C/C++/Arduino but your proposal doesn't fix the issue for me. |
I see. Implementation of available() is wrong too |
Same here... why is the |
Any workaround about this issue? I tried @JAndrassy's reply but not worked here either |
I would remove |
@JAndrassy thanks for the quick reply. I will try that here and report the results |
@JAndrassy I made both changes, but unfortunately same result :/ |
Describe the bug
SSLClient::connected
stops with "Socket was dropped unexpectedly" because m_client is done and returns false forconnected()
but SSLClient still has unread data in buffer.To Reproduce
I tested SSLClient library with my networking libraries EthernetENC and WiFiEspAT. Both end with this error in EthernetHTTPS.ino example. EthernetENC reads more data than WiFiEspAT but both stop reading before all data are read.
If I remove
if (!client.connected()) {
from the example, all data are read.Expected behavior
It is a valid state that m_client is already closed and doesn't have data so it returns false for
connected()
. SoSSLClient::connected
should not stop() and report disconnect while it still has data in buffer.connected()
is specified to return true while data are available. https://www.arduino.cc/en/Reference/ClientConnectedScreenshots/Serial Output
Context:
The text was updated successfully, but these errors were encountered: