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

Re: WebSocket API clise Method

From: Takashi Toyoshima <toyoshim@chromium.org>
Date: Wed, 1 Feb 2012 13:43:30 +0900
Message-ID: <CAFWCB1nqqKeKxVZUcCNjJWykwg5PbV19d5wCXPnkEVSc4ojFPA@mail.gmail.com>
To: Bronislav Klučka <Bronislav.Klucka@bauglir.com>
Cc: public-webapps@w3.org
Hi Bronislav,

On Tue, Jan 31, 2012 at 11:09 PM, Bronislav Klučka
<Bronislav.Klucka@bauglir.com> wrote:
> Hello,
> based on this bug
> http://code.google.com/p/chromium/issues/detail?id=93609
> referencing
> http://dev.w3.org/html5/websockets/#dom-websocket-close
>
> Looking in WebSocket protocol close codes definitions
> http://tools.ietf.org/html/rfc6455#section-7.4.1
>
> I wonder about codes
>
> 1003 indicates that an endpoint is terminating the connection
>      because it has received a type of data it cannot accept (e.g., an
>      endpoint that understands only text data MAY send this if it
>      receives a binary message).
>
> 1008 indicates that an endpoint is terminating the connection
>      because it has received a message that violates its policy.  This
>      is a generic status code that can be returned when there is no
>      other more suitable status code (e.g., 1003 or 1009) or if there
>      is a need to hide specific details about the policy.
>
> 1009 indicates that an endpoint is terminating the connection
>      because it has received a message that is too big for it to
>      process.
>
>
> Those are/maybe application level codes (generic one). E.g. your WS
> implementation supports

To my understanding, these codes are used by browser and server layer.
For example, 1003 may mean the browser doesn't support binary type frames
in its WebSocket protocol stack.

Meaning of application level binary support will depend on application level
subprotocols. You may want to define application level close code in
the range 3000 to 4999 to notify that client doesn't support some
kinds of features.
Or you can define some feature negotiating frameworks over your subprotocols.

Application level error code could be useful for server side
application handler.
In this case, it doesn't matter if the server side protocol stack
itself understand
these application level codes.

> both text and binary types (in browser), but your application expects only
> text messages (1003).
> Client (application) expects first message from server to contain specific
> information, but server fails to provide (1008).
> Client (application) have requested certain data, e.g. part of a file, but
> data received from server are bigger than requested.
>
> Application level codes (3000-4999) does not apply here, because in my
> previous examples shows, that server
> simply did not understand the application protocol in a first place, so it
> makes no sense for client to send
> application level close codes to server - those codes would have no meaning
> there.
>
>
> Brona
>
>
Received on Thursday, 2 February 2012 17:41:11 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:50 GMT