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
@micahbule, I am sorry, but TCP does not provide an explicit disconection event, since it is an idle protocol. You can find more information on this article about half-open connection:
TCP does have acknowledgments for data, so when one side sends data to the other side, it will receive an acknowledgment if the connection is stil active (or an error if it is not). Thus, broken connections can be detected by sending out data. It is important to note that the act of receiving data is completely passive in TCP; a socket that only reads cannot detect a dropped connection.
You will need to configure your communication protocol to detect a dropped connection. So, all you need to do is to try reading at some interval, and if the read fails, the connection has dropped.
Description
onClose
event doesn't fire when a TCP client loses WiFiSteps to reproduce
Steps to reproduce the behavior:
device1
.device2
and connect todevice1
.device2
.Current behavior
Client's socket in the TCP server is still connected.
Expected behavior
Client's socket in the TCP server must be disconnected.
Relevant information
The text was updated successfully, but these errors were encountered: