Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to receive heartbeat? #18

Closed
starlight173 opened this issue Feb 8, 2018 · 5 comments
Closed

How to receive heartbeat? #18

starlight173 opened this issue Feb 8, 2018 · 5 comments
Assignees

Comments

@starlight173
Copy link

starlight173 commented Feb 8, 2018

screen shot 2018-02-08 at 11 41 17 am

It works very well on browser, but I dont receive ping on mobile device. The state is connected and heartbeat is 30s.

“CONNECTED\nheart-beat:30000,30000\nuser-name:00udiekv7oJmG5cZk0h7\n\n\0”

Do you have any suggestion?

@starlight173 starlight173 changed the title Ping not receiving How to receive heartbeat? Feb 8, 2018
@WrathChaos
Copy link
Owner

I need to work on it.
If you have time, you can help me about this issue :)
Have fun!

@WrathChaos WrathChaos self-assigned this Feb 8, 2018
@starlight173
Copy link
Author

My server is using Stomp 1.1 with heartbeat configuration. Actually I fixed this by add heartbeat to header field to ask it ping me.
["hear-beat": "0,30000"] // I cannot send heartbeat, I ask server to ping me every 30s

I think you already implement it - the ping pong stuff, add it to document is OK. Just missing the function ping server side in case you want the client to be more active.

@WrathChaos
Copy link
Owner

@gloryluu I just could not test it on my side that's why it might needs some enhancements :) Thank you so much for feedback, I will add it on the documents.
Have fun sir :)

@ThanhTrung90
Copy link

ThanhTrung90 commented May 12, 2020

Hi @WrathChaos , @gloryluu . My server is using Stomp 1.1 and in browser, I also receive server's pong but in mobile I can't receive server's pong (although I add ["hear-beat": "0,30000"] to header)
socketClient.openSocketWithURLRequest(request: request as NSURLRequest, delegate: self, connectionHeaders: ["hear-beat": "0,30000"])
Do you have any suggestion?

@WrathChaos
Copy link
Owner

WrathChaos commented May 15, 2020

Hi @ThanhTrung90,
Have you ever tested with another platform with another library? Like on Android? It should work with this library but generally, it fails on the backend side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants