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

Client stops receiving messages 60 seconds after load #5

Closed
hojgr opened this issue Jun 4, 2016 · 5 comments
Closed

Client stops receiving messages 60 seconds after load #5

hojgr opened this issue Jun 4, 2016 · 5 comments

Comments

@hojgr
Copy link

hojgr commented Jun 4, 2016

Hello,

awesome package! After a little fiddling around I got it to work but encountered something weird. My backend is broadcasting message every 200 ms. Those are 3 messages that alternate (1,2,3,1,2,3,...)

But 60 seconds after loading the page the messages stop coming. Server is still sending them (on refresh it works again) but nothing happens on client. No onClose message comes to update, no error (I think) happens.

What could be the problem? Has it happend to anyone else?

Thanks!

@fbonetti
Copy link
Owner

fbonetti commented Jun 4, 2016

Have you tried withDebug? It prints every message from the server to the console. Can you try that and let me know what you see?

On Jun 4, 2016, at 4:54 PM, Michal Hojgr [email protected] wrote:

Hello,

awesome package! After a little fiddling around I got it to work but encountered something weird. My backend is broadcasting message every 200 ms. Those are 3 messages that alternate (1,2,3,1,2,3,...)

But 60 seconds after loading the page the messages stop coming. Server is still sending them (on refresh it works again) but nothing happens on client. No onClose message comes to update, no error (I think) happens.

What could be the problem? Has it happend to anyone else?

Thanks!


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@hojgr
Copy link
Author

hojgr commented Jun 4, 2016

Yes, I do have it on. Messages just stop being printed too.

@hojgr
Copy link
Author

hojgr commented Jun 4, 2016

I fixed it. Phoenix's Phoenix.Transports.WebSocket has a :timeout option that is set to 60 second by default. I've set it to :infinity and it works like a charm.

@hojgr hojgr closed this as completed Jun 4, 2016
@fbonetti
Copy link
Owner

@hojgr This may be related to #7

@OvermindDL1
Copy link

Yeah setting this to :infinity is very very bad and can cause old connections that should be dropped to remain open until the 30minute TCP timeout. @hojgr you should not set that to infinity and until this library fixes the heartbeat then you should perform your own heartbeat (send anything once every twenty-thirty seconds or so). This is what the heartbeat is for and makes it plainly obvious that the heartbeat is not implemented yet.

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

No branches or pull requests

3 participants