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?
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.
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?