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

StompClient Disconnection. #10

Closed karibandi closed 6 years ago

karibandi commented 6 years ago

I have been using your stomp client library for a while and its working great ,but the only problem i'm facing is disconnecting the stomp , I've tried calling the "stompClientDidDisconnect()" and "stompClientWillDisconnect()", where even after unsubscribing the topic i'm still getting the hits from server, Could you please help with the issue?.

WrathChaos commented 6 years ago

Hey Karibandi, Have you called "stopClientDidDisconnect(client: socketClient)" ? Example :

 func stompClientDidDisconnect(client: StompClientLib!) {
        if socketClient.isConnected(){
            socketClient.unsubscribe(destination: topic!)
            socketClient.disconnect()
            print("Socket is Disconnected")
        }
    }
karibandi commented 6 years ago

No, i tried calling the same with out that if condition ,now i have tried the above code and it is working like a charm. Thanks Kuray.