https://www.w3.org/Bugs/Public/show_bug.cgi?id=15210

           Summary: Consider dispatching an event when bufferedAmount
                    drops to 0
           Product: WebAppsWG
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: WebSocket API (editor: Ian Hickson)
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
                CC: [email protected], [email protected]


Right now the spec has example
socket.onopen = function () {
    setInterval(function() {
      if (socket.bufferedAmount == 0)
        socket.send(getUpdateData());
    }, 50);
  };

That works, sure, but in many cases there shouldn't be a need for such
interval.
Especially in worker context something like:
socket.onemptybuffer = function () {
    socket.send(getUpdateData());
  };
could work quite nicely.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Reply via email to