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

Hi,

I am listing the changes to be done in http://raw-sockets.sysapps.org/. Please inform me if you have another interpretation of any of the decisions taken.

·        For reading simplicity restructure the API so that there are three main interfaces according to below:

o   interface UDPSocket : EventTarget

o   interface TCPSocket : EventTarget

o   interface TCPServerSocket : EventTarget


·        Align syntax and semantics as much as possible with Web Sockets. In the future an API supporting UDP, TCP and Web Sockets might be an option. However, note that security is more of a concern for UDP and TCP sockets than for Web Sockets. The current Web Sockets API is available to browser web pages, while the Raw Socket API is only available to trusted applications running in the secure Web System Apps execution environment.


·        UDPSocket

o   Constructor is incorrect. Update according to example 2, which is correct. This means that there will be one argument in the constructor, i.e. optional UDPOptions, which contains the localAddress and localPort attributes.

o   Consider replacing the UDP examples in order not to describe functionality that can be achieved with another W3C API, i.e. the DAP Network Service Discovery API.

o   Instead of letting the API implementation join multicast groups by looking at the local/remote addresses and join multicast group if the address is between 224.0.0.0 and 239.255.255.255 there should be explicit methods for joining and leaving multicast groups. This is clearer for developers.

o   Add an explicit method for closing/destroying a UDP socket (we shouldn't rely on garbage collection only)

o   Add a method for setting peer Address and port for sending UDP data. That way, it is possible to use send() methods without specifying an address.

o   Attribute for TTL of messages sent: Leave it for now. If we have use cases it can be added.



·        TCPSocket

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?)

o   Add method halfClose() and event when done.
(Claes comment: We might need additional states in "readyState", "halfclosing" and "halfclosed"?)


·        Both UDP and TCP

o   Buffering send data: There should be a limit that is implementation dependent for when send() returns false indicating that the application should wait until the transport layer has transmitted buffered data that already have been written to the socket before buffering more. No absolute "max send buffer" limit should be stated. If the application is poorly written and ignores the "false return" from send()  and continues to send then it will consume it's dynamic memory and crash.

o   Data types for sending and receiving: Align with the Web Sockets API

o   Readonly attribute stating IPversion 4 or 6: Leave it for now. If we have use cases it can be added.

o   Using a URL as an option for peer address:  Leave it for now. If we have use cases it can be added.


Best regards
  Claes

Claes Nilsson M.Sc.E.E
Master Engineer - Web Research
Advanced Application Labs

Sony Mobile Communications
Tel: +46 705 56 68 78
sonymobile.com<http://sonymobile.com/>

[cid:image001.jpg@01CE35CE.5A575110]

Received on Wednesday, 10 April 2013 13:14:07 UTC