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 15210 - Consider dispatching an event when bufferedAmount drops to 0
Summary: Consider dispatching an event when bufferedAmount drops to 0
Status: RESOLVED REMIND
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: WebSocket API (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: Other other
: P3 enhancement
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: public-webapps-bugzilla
URL:
Whiteboard: v2; might mark this LATER after check...
Keywords:
Depends on:
Blocks: 15209
  Show dependency treegraph
 
Reported: 2011-12-15 13:20 UTC by Olli Pettay
Modified: 2012-12-31 04:59 UTC (History)
6 users (show)

See Also:


Attachments

Description Olli Pettay 2011-12-15 13:20:42 UTC
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.
Comment 1 Ian 'Hixie' Hickson 2012-01-28 22:13:34 UTC
Yeah, that's probably reasonable. I expect we'll add this in due course. Probably best to let the implementations catch up with the protocol changes and deploy more widely before adding more stuff, though.
Comment 2 Ian 'Hixie' Hickson 2012-07-24 06:00:27 UTC
This should probably be done at the same time as bug 15209.
Comment 3 Ian 'Hixie' Hickson 2012-12-31 04:59:29 UTC
Marking this and bug 15209 as REMIND for now. Will reopen in a few months and see whether we've found that it's a real problem or not.