<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>14115</bug_id>
          
          <creation_ts>2011-09-12 09:29:38 +0000</creation_ts>
          <short_desc>WebSocket API should allow sending WS Ping frames from client to server</short_desc>
          <delta_ts>2011-09-12 19:47:42 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>13104</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Iñaki Baz Castillo">ibc</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>art.barstow</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>56659</commentid>
    <comment_count>0</comment_count>
    <who name="Iñaki Baz Castillo">ibc</who>
    <bug_when>2011-09-12 09:29:38 +0000</bug_when>
    <thetext>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 &quot;ping&quot; 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(&quot;ws://some-domain.com&quot;);
    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 &quot;DISCONNECTED&quot; or &quot;DISCONNECTING&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56669</commentid>
    <comment_count>1</comment_count>
    <who name="Arthur Barstow">art.barstow</who>
    <bug_when>2011-09-12 18:52:01 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56672</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2011-09-12 19:47:42 +0000</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 13104 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>