Open JAndrassy opened 3 years ago
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.
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
if (available())
return true;
at the beginning of connected
@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.
@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
@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 available()
method wrong?
@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.
Any workaround about this issue? I tried @JAndrassy's reply but not worked here either
I would remove if (!m_soft_connected(func_name)) return 0;
then maybe the state is right
@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: