You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experiencing exactly the same issue. If I fail to connect a few times after getting this message I then get an out of memory exception. It's my understanding that “Bad File Number” error (Errno: 9) in a multithreaded application error, an “Opened once but closed twice” bug. So when thread “Y” carries out its second close(), it actually closes the file descriptor of thread “X”, which was valid & in use. I'm not sure if this is what is causing my our of memory exception, but since setNoDelay(true) disables the Nagle algorithm, that intends to reduce TCP/IP traffic of small packets sent over the network by combining a number of small outgoing messages, and sending them all at once, I think Boris' suggestion is a good one.
Hi Markus,
on ESP32 it seems that
setNoDelay(true)
does not work and causing the "Bad file number" error when WebSocketsClient connects to a server.setNoDelay(true)
is called inconnectedCb
in WebSocketsClient.cpp:arduinoWebSockets/src/WebSocketsClient.cpp
Lines 865 to 866 in a14b6b7
I tried to follow the path to see where the error comes from, but I ended up in
lwip_setsockopt_r
in lwip.hAt this point my knowledge left me :(
I think the ESP32 should be removed from from the
#if
macro - what do you think?The text was updated successfully, but these errors were encountered: