[whatwg] WebSocket bufferedAmount includes overhead or not.
ap at webkit.org
Fri Mar 5 09:54:24 PST 2010
On 04.03.2010, at 1:52, Olli Pettay wrote:
>> I noticed that WebSocket spec updated to not inlcude framing
>> overhead in
> I asked that since from API point of view it doesn't make
> much sense to have the frame bytes to be magically included in the
> What if we change the protocol and require different amount framing
I was going to mention this as the primary reason why frame bytes
control, and it's raw bytes that are sent over the tubes, not original
Also, I think it's a layering violation. In WebKit, we'd have to queue
unsent messages separately just to implement this quirk (see https://bugs.webkit.org/attachment.cgi?id=50093
for a proof of concept). It becomes very difficult to implement we
decide to add size of data that an underlying network library buffers
internally - which I think would be a reasonable thing to do.
> Also why to have framing bytes and not the bytes related to http
Nothing would change for engines or JS code if HTTP headers were
counted in bufferedAmount. Since they are only sent when establishing
a connection, adding a small constant at the beginning will make no
difference to flow control. And the constant is going to be zero in
practice, because the data will immediately go where we can't see it.
- WBR, Alexey Proskuryakov
More information about the whatwg