RE: [sysapps/raw socket api]: List of changes to be done based on Madrid session 2013-04-09

Thanks Ke-Fong,

See inline below.

Claes

> -----Original Message-----
> From: Ke-Fong Lin [mailto:ke-fong.lin@4d.com]
> Sent: den 10 april 2013 21:04
> To: Nilsson, Claes1; public-sysapps@w3.org
> Cc: Isberg, Anders; Edenbrandt, Anders; Isaksson, Björn; Falk, Mattias
> Subject: RE : [sysapps/raw socket api]: List of changes to be done
> based on Madrid session 2013-04-09
> 
> Hi Claes,
> 
> Just a few comments:
> 
> >o   Add method upgradeToSSL() and event when done
> >(Claes comment: TLS could be used so maybe we should call the method
> upgradeToSecureTransport()? In addition, do we need this for UDP as
> well?)
> 
> Yes, that's probably better naming.
> You'll have to add constructors with provision for certificate of
> server to connect to.
[Claes] Yes, setting up a secure transport channel is more complicated. Compare for example with http://docs.oracle.com/javase/6/docs/api/javax/net/ssl/SSLSocket.html. We have to consider what we need for web system apps. Do you have a tangible proposal for how this would look like in our API?
> As for UDP, there is no widely used standard for secured communication
> and no SSL/TLS equivalent.
[Claes] There are use cases for secure transport over UDP but I'll investigate that and will come back.
> 
> >o   Add method halfClose() and event when done.
> >(Claes comment: We might need additional states in “readyState”,
> “halfclosing” and “halfclosed”?)
> 
> 1) This will add 2 more states and break possible "compatibility" with
> WebSocket.
> 
> 2) I'll need to double check that, but I don't think there is a need
> for an "halfClosing" state. To indicate "half closing" (I won't send
> further data but just listen), a "FIN" packet has to be sent. This is
> of course not instantaneous. Yet, Berkeley socket implements that using
> the shutdown() function, which can even tell the OS that a particular
> socket won't receive any data anymore. For that, there is no TCP
> protocol related associated action, it's just the OS preventing you to
> read. As for write, it (the OS) prevents (with immediate action) data
> to be written and does sends the FIN packet to the peer. So you
> basically just go to the "halfClosed" state immediately, even if the
> peer may not know it yet.
> 
> 3) I would rather suggest that half closing doesn't affect readyState,
> but is just a halfClosed read-only attribute set to true or false by
> the API's implementation.
[Claes] That means a synchronous method halfClose(). I agree with Jonas that we should add a state "halfclosed". Using a separate attribute to indicate this state seems inconsistent. So the steps executed by the UA when halfClose() is called would be:
* Half close the connection (send FIN) and set the readyState attribute to "halfclosed".
> > o   Data types for sending and receiving: Align with the Web Sockets
> API
> 
> As suggested by Jonas, take everything as ArrayBuffer, you can always
> do a toString() if needed.
[Claes] Ok, we will skip binaryType and always return data as ArrayBuffer.
> 
> 
> Enjoy your paella at the restaurant :)
[Claes] Yes, I will tonight :-)
> 
> Best regards,
> 
> 
> 
> 
> Ke-Fong Lin
> Développeur Senior
> 
> 4D SAS
> 60, rue d'Alsace
> 92110 Clichy
> France
> 
> Standard :
> Email :    Ke-Fong.Lin@4d.com
> Web :      www.4D.com
> 

Received on Thursday, 11 April 2013 08:43:21 UTC