6

I have a Play Framework application, serving as a WebSocket server, running on Heroku and some WebSocket clients (chat-like application).

I noticed that Heroku closes each connection after 55 seconds of inactivity and I want to prevent this so I thought about creating a mechanism in my Play application that sends some kind of "ping" to each client in order to keep the connections alive.

I am just wondering if this is the way to go? Am I am missing something crucial here?

Best regards

2
  • I believe Heroku is actually rolling out updates that remove the timeout rules. Got an email recently about that Commented Apr 8, 2014 at 6:38
  • @alumns I also got such an email and followed the link provided in it where they have again mentioned that there is still a rolling 55 seconds window, so either client or server must somehow keep the connection alive Commented Apr 8, 2014 at 8:03

1 Answer 1

8

I am just wondering if this is the way to go?

Yes. Here's what Heroku writes

The normal Heroku HTTP routing timeout rules apply to the WebSocket labs feature. Either client or server can prevent the connection from idling by sending an occasional ping packet over the connection.

https://devcenter.heroku.com/articles/heroku-labs-websockets#timeouts

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.