This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 14115 - WebSocket API should allow sending WS Ping frames from client to server
Summary: WebSocket API should allow sending WS Ping frames from client to server
Status: RESOLVED DUPLICATE of bug 13104
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: Other other
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-12 09:29 UTC by Iñaki Baz Castillo
Modified: 2011-09-12 19:47 UTC (History)
4 users (show)

See Also:


Attachments

Description Iñaki Baz Castillo 2011-09-12 09:29:38 UTC
WebSocket API does not define how the client can send a Ping frame:

  http://dev.w3.org/html5/websockets/#the-websocket-interface

Sometimes the Internet connection is gone and the client has not realized that the TCP connection is dead (it does not realize of it until it tries to send data over the connetion). So, in this case, the client has no way to realize that the TCP connection (or the WS connection) is unavailable. The only way would be defining a "ping" mechanism at WS subprotocol level, which would be ugly having Ping/Pong frames already defined in WS transport protocol.

So, IMHO the WS API should include a mechanism for the client (the web browser typically) to send WS ping to the server periodically. For example:

    var myWS = new WebSocket("ws://some-domain.com");
    myWS.monitor_interval(120);

In this way, the API user instructs the WebSocket client to send a Ping frame every 120 seconds. In case a Pong is not received within N seconds (to define) the WS socket state would become "DISCONNECTED" or "DISCONNECTING".
Comment 1 Arthur Barstow 2011-09-12 18:52:01 UTC
Is this a dup of Web Socket API bug 13104:

  http://www.w3.org/Bugs/Public/show_bug.cgi?id=13104 

Also, seems like this should be assigned to WebApps Web Socket API spec.
Comment 2 Simon Pieters 2011-09-12 19:47:42 UTC

*** This bug has been marked as a duplicate of bug 13104 ***