troyzhxu/okhttps

"You must call connect before send" error

Closed this issue · 2 comments

Hi,

when user open screen, send connect request and click back button quickly and call disconnect(true) library throw "You must call connect before send". I think we have to add control here;
https://github.com/ejlchina/okhttps/blob/f6e3e50ac38f1c53502b78a942269a97047d2a6f/okhttps-stomp/src/main/java/com/ejlchina/stomp/Stomp.java#L115

Or do you have any suggestion?
In my code, connect in onResume, disconnect in onPause.

Thanks for this library 😎

Thanks for reporting this bug. It will be fixed in next version.
And now you can try disconnect() or disconnect(int maxWaitSeconds) instead.