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

bug: set connection variable to "false", before calling serverDidSendError or stompClientDisconnect #124

Closed JuyeonYu closed 1 year ago

WrathChaos commented 1 year ago

Hello @JuyeonYu Can you explain why we need it? What does it solve? What is the bug etc?

JuyeonYu commented 1 year ago

Hello @WrathChaos this PR keeps consistency of the "connection" variable. It is based on https://github.com/WrathChaos/StompClientLib/issues/123

When the client actively disconnect, the "connection" variable set to false. So I double check the "connection" variable in stompClientDisconnect. Because of preventing from reconnect and business logic etc. Web socket is closed and "connection" variable is false. It is happy case.

But the thing is different when the web socket is closed with some reasons. Because the "connection" variable remains true even the web socket is closed. So I have been manually changing the connection variable set to false in serverDidSendError and stompClientDisconnect.

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.