WrathChaos / StompClientLib

Simple STOMP Client library, Swift 3 and 4, 4.2, 5 compatible
https://www.freakycoder.com
MIT License
154 stars 81 forks source link

Connection variable is not set to false when WebSocket receives DISCONNECT #123

Open jasons-medistaff opened 1 year ago

jasons-medistaff commented 1 year ago

When the client actively disconnects or unsubscribes, "connection" variable is correctly set to false. However, when the client receives a DISCONNECT packet, the WebSocket is successfully torn down, but the "connection" variable remains true.

We have code that checks for isConnected(), and rebuild the connection if it is false. Since the "connection" variable is not set to false, we do not have a way to check if the WebSocket connection is active or not.

As a workaround, we change the "connection" variable inside the stompClientDidDisconnect function. However, we are afraid that this may cause problems inside the Stomp library code.

Is there a reason why "connection" variable is only set to false when the client disconnects and not when the connection is shutdown?

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.