W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2011

Binary data in WebSockets API (was RE: [Bug 12102] New: WebSocket protocol update time)

From: Adrian Bateman <adrianba@microsoft.com>
Date: Thu, 24 Feb 2011 23:50:21 +0000
To: "public-webapps@w3.org" <public-webapps@w3.org>
Message-ID: <104E6B5B6535E849970CDFBB1C5216EB3D0BFD79@TK5EX14MBXC138.redmond.corp.microsoft.com>
As we've been updating our WebSockets prototype [1] in line with the latest protocol
changes we've been thinking about how the binary support that the protocol now
includes should be reflected in the API. I added the following comment to the bug:

    At Microsoft, we've been reviewing how the binary support now enabled by the
    WebSocket protocol might be exposed in the API.

    In line with Ian's notes in this bug, we'd like to see the send() method accept
    a Blob argument that indicates to the API that a binary message should be sent.
    The existing definition with a string should send a text message.
    Implementations can decide how they choose to break up the message into
    intermediate frames since this isn't exposed to the API.

    On the receiving side, we think that the event.data attribute should contain a
    Blob if the message was a binary message and a remain as a string for text

    Since MessageEvent already defines data to be of type 'any', the change here
    would be to describe the semantics of text vs. binary messages in section 5 of
    the spec.

    For the send method, we'd expect an overload of send in section 4 as follows:
        void send(in Blob data);

We'd be interested to hear how others have been thinking about this.



[1] http://html5labs.interoperabilitybridges.com/prototypes/available-for-download/websockets 

-----Original Message-----
From: public-webapps-request@w3.org [mailto:public-webapps-request@w3.org] On Behalf Of bugzilla@jessica.w3.org
Sent: Wednesday, February 16, 2011 5:52 PM
To: public-webapps@w3.org
Subject: [Bug 12102] New: WebSocket protocol update time


           Summary: WebSocket protocol update time
           Product: WebAppsWG
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: WebSocket API (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: ian@hixie.ch
         QAContact: member-webapi-cvs@w3.org
                CC: mike@w3.org, public-webapps@w3.org

* onclose should have unsigned int reasonCode and DOMString reasonMessage.
* readonly attribute DOMString extensions; // ianf will provide a hook
* send() takes some sort of binary argument and
* onmessage event.data exposes binary data
* check through http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol
to make sure the hooks still work

Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Received on Thursday, 24 February 2011 23:51:11 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:16 UTC