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.
As for UDP, there is no widely used standard for secured communication and no SSL/TLS equivalent.

>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.

> 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.


Enjoy your paella at the restaurant :)

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 Wednesday, 10 April 2013 19:02:07 UTC