Open indianakernick opened 3 years ago
Hey, are there any updates to this? I used a temporary fix by adding heartbeats to my websocket (akin to how Discord's gateway functions), but I feel like it would be best if this was addressed on the library's side.
Version
Platform
Description I'm noticing something odd happening when websockets are disconnected. It seems as though the end of the function called inside
on_upgrade
isn't always reached when the socket is disconnected. I'm talking about this line from the example. Sometimes the socket is disconnected without reaching that line.The trouble is, this only happens sometimes. It's rare but just often enough for me to notice. I don't know how to reproduce it so maybe this can't be fixed. My code is pretty similar in structure to the example. I'm wondering, is there some way for the socket to be disconnected without reaching that line?
After some investigation. This seems to happen when the network connection is abruptly cut off. I'm able to consistently reproduce this problem whenever I cut the connection. I'm using a modified version of the websocket example:
If the client disconnects gracefully, the
Disconnected
message is printed (along withConnection reset without closing handshake
). If the network connection is cut, nothing is printed.