Subject: [hybi] Receiving side browser API for WebSockets?

From: "Martin J. Dürst" <[email-masked]>
Date: Wed, 08 Apr 2009 10:51:25 +0900

Hello Ian,

In your postings, you gave quite a few examples of the API a browser 
would use to send data on the WebSockets protocol. That seems quite easy 
and straightforward. However, what I wonder is how the API on the 
receiver side (because we are bidirectional, this may also be the 
browser) may/will look. By experience, the receiving side is always more 
tricky than the sending side.

Regards,    Martin.

-- 
#-# Martin J. Dürst, Professor, Aoyama Gakuin University
#-# http://www.sw.it.aoyama.ac.jp   mailto:[email-masked]

---

From: Ian Hickson <[email-masked]>
Date: Wed, 8 Apr 2009 05:23:52 +0000 (UTC)

> tricky than the sending side.

The server-side implementation is up to the author.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

---

From: Paul Prescod <[email-masked]>
Date: Tue, 7 Apr 2009 22:40:05 -0700

> The server-side implementation is up to the author.

I believe that Martin was asking about the details onmessage event
handler and the MessageEvent interface.

 Paul

---

From: Ian Hickson <[email-masked]>
Date: Wed, 8 Apr 2009 05:46:45 +0000 (UTC)

> handler and the MessageEvent interface.

Oh. This is defined in the same place as the sending API:

   http://dev.w3.org/html5/websockets/

The MessageEvent interface is defined in HTML5:

   http://www.whatwg.org/specs/web-apps/current-work/#messageevent

HTH,

---

From: "Martin J. Dürst" <[email-masked]>
Date: Wed, 08 Apr 2009 18:27:16 +0900

I was not (only) talking about the server side implementation.
I'm assuming that WebSockets, like TCP, is bidirectional. So I'm
assuming that the server can send the client the same kind of packages
that the client can send the server (UTF-8 and length-limited binary,
the later at least planned).

Based on that assumption, I'm wondering what the receiving API on the 
*client* side is going to look. I was thinking that was clear enough 
from my mail, and I hope it's clear now.

Regards,   Martin.

---

From: "Martin J. Dürst" <[email-masked]>
Date: Thu, 09 Apr 2009 12:19:35 +0900

Hello Ian,

>     http://dev.w3.org/html5/websockets/

I see. That seems reasonable. I was wondering about it mostly because of 
the comparison with TCP. For TCP, as far as I understand, the idea is 
that packets are internal to TCP, that applications do not know and do 
not care whether some data came all in one packet or was split up.

For WebSockets, that's different, each datagram is handled separately to 
the client. That makes parsing on the receiver side reasonably easy.

>     http://www.whatwg.org/specs/web-apps/current-work/#messageevent

[That crashed my browser (Opera 9.64 on Vista) several times yesterday, 
but today, I was able to look at it.]

Regards,    Martin.