firehoseio / firehose

Build realtime Ruby web applications. Created by the fine folks at Poll Everywhere.
http://firehose.io/
MIT License
726 stars 72 forks source link

Long running websocket connection may die of inactivity #12

Closed steel closed 12 years ago

steel commented 12 years ago

Implement ping pong frames and keep WS alive when idle. Maybe send ping frame after 20 seconds of inactivity?

http://www.whatwg.org/specs/web-apps/current-work/multipage/network.html#ping-and-pong-frames

zdzolton commented 12 years ago

So far as I can tell, there's no standard representation for ping-pong frames, correct? Then I this should be pretty easy to implement, since we can just use the current functionality.

https://www.pivotaltracker.com/story/show/37905799

On Tue, Oct 16, 2012 at 5:19 PM, Steel Fu notifications@github.com wrote:

Implement ping pong frames and keep WS alive when idle. Maybe send ping frame after 20 seconds of inactivity?

http://www.whatwg.org/specs/web-apps/current-work/multipage/network.html#ping-and-pong-frames

— Reply to this email directly or view it on GitHubhttps://github.com/polleverywhere/firehose/issues/12.

steel commented 12 years ago

New implementation is great. 1 more thing I just ran into. Firehose.CleanUp should remove the timer for the next ping. Currently running into js errors because doPing is executed after connection has been manually closed.

zdzolton commented 12 years ago

Okay, I'll make sure to handle the cleanup step!

On Thu, Oct 25, 2012 at 3:18 PM, Steel Fu notifications@github.com wrote:

New implementation is great. 1 more thing I just ran into. Firehose.CleanUp should remove the timer for the next ping. Currently running into js errors because doPing is executed after connection has been manually closed.

— Reply to this email directly or view it on GitHubhttps://github.com/polleverywhere/firehose/issues/12#issuecomment-9792512.

zdzolton commented 12 years ago

@Steel I pushed another commit to the keepalive-ping branch to cancel the ping timeout in the cleanup code.

Give it a whirl, and lemme know!

On Thu, Oct 25, 2012 at 3:18 PM, Steel Fu notifications@github.com wrote:

New implementation is great. 1 more thing I just ran into. Firehose.CleanUp should remove the timer for the next ping. Currently running into js errors because doPing is executed after connection has been manually closed.

— Reply to this email directly or view it on GitHubhttps://github.com/polleverywhere/firehose/issues/12#issuecomment-9792512.