WrathChaos / StompClientLib

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

Connection close after 1 minute When I set "heart-beat: 30000, 0" #98

Closed kitty0109 closed 3 years ago

kitty0109 commented 3 years ago

image

I tried to use STOMP 1.2 on IOS APP with STOMP's heartbeat header: heart-beat:30000, 0. But the WebSocket connection closed after 1 minute. PS: this heart-beat header works for Android APP. Could anyone help me check what's going wrong?

WrathChaos commented 3 years ago

Hello @kitty0109

Thank you for using this library and reaching me :)

You should ping the server within a specific interval.

https://github.com/WrathChaos/StompClientLib/issues/96#issuecomment-710030428

["heart-beat": "0,10000"] disconnected after certain time but when changed to ["heart-beat": "10000,10000"], did not disconnect and ping is happening at regular intervals, keeping the connection alive.

Here is the current solution.

Please let me know if it is working for you

kitty0109 commented 3 years ago

Hello @kitty0109

Thank you for using this library and reaching me :)

You should ping the server within a specific interval.

#96 (comment)

["heart-beat": "0,10000"] disconnected after certain time but when changed to ["heart-beat": "10000,10000"], did not disconnect and ping is happening at regular intervals, keeping the connection alive.

Here is the current solution.

Please let me know if it is working for you

It works! Thanks for your reply.