W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2011

[whatwg] WebSocket framing

From: Bronislav Klučka <Bronislav.Klucka@bauglir.com>
Date: Sun, 21 Aug 2011 11:05:08 +0200
Message-ID: <4E50CA44.3020407@bauglir.com>
Hello,
I'm looking at current WebSocket interface specification
http://www.whatwg.org/specs/web-apps/current-work/complete/network.html#the-websocket-interface

1/ and I'm missing the ability to specify, whether data to be sent are 
final or not (whether the frame to be sent should be continuous or not)
I suppose some parameter for specifying final/continuing frame should be 
there, or some new methods for framing. I've tried to send 100 MiB text 
from Chrome for testing purposes and since there is no way to specify 
framing it was send in one piece.  There is no way to stream data from 
client to server, all data must be kept in memory and sent at once.

2/ The same issue for receiving. I understand the need for simple API. 
But again, there is streaming ability missing, all data are received at 
once. Receiving large amount of data could hang up browser. There should 
be onFrameMessage event intercepting frames one by one and (probably by 
some event property) define, whether all those frames should be cached 
and finally exposed by onMessage event (true by default). Programmer 
than can choose to ignore such event (not implement it) and receive all 
messages by onmessage event or implement it, use it for streaming, and 
possibly prevent onMessage calls and unnecessary caching of large data

3/ MessageEvent should expose what kind of data was received, textual, 
blob or arrayBuffer. This would prevent testing for data type and 
problems with testing |binaryType 
<http://dev.w3.org/html5/websockets/#dom-websocket-binarytype> |property 
if changed during data receiving.

Brona Klucka
Received on Sunday, 21 August 2011 02:05:08 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:35 UTC