W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2009

[whatwg] Web Sockets API — send() with closed connections

From: Avi Flax <avif@arc90.com>
Date: Sun, 25 Oct 2009 13:12:45 -0400
Message-ID: <5c02bc4e0910251012l619a1274t240cf24662ee4679@mail.gmail.com>
My apologies if this has been answered before; I searched the list and
found some similar questions but no answers.

I just read the latest draft of this API, and it's great, very exciting.

Just one thing struck me as odd: calling send(data) on a?WebSocket
whose readyState is CONNECTING raises an INVALID_STATE_ERR exception,
but calling send(data) on a WebSocket whose readyState is CLOSED does
not raise an exception; it merely returns false.

This is confusing to me; I would think that a WebSocket which is in
the process of connecting is in an invalid state for sending data,
then one which has closed its connection is also in an invalid state
for sending data.

I'd really appreciate it if someone could explain the rationale for
this to me. And I might also suggest that calling send(data) on a
WebSocket whose readyState is CLOSED _should_ raise an exception ??but
I should probably wait to see first what thinking has already gone
into this ? I'm sure brighter minds than I have thought this through.



Avi Flax ? Partner ? Arc90 ? http://arc90.com
Received on Sunday, 25 October 2009 10:12:45 UTC

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