Bug 15210 - Consider dispatching an event when bufferedAmount drops to 0
Summary: Consider dispatching an event when bufferedAmount drops to 0
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
Whiteboard: v2; might mark this LATER after check...
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:


Note You need to log in before you can comment on or make changes to this bug.
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)
    }, 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 () {
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.