RE: [sysapps/raw socket api]: New version based on Madrid meeting comments and comments from Ke-Fong Lin

Hi Claes,

Your proposal sounds good to me.

Kr,
Christophe DUMEZ.

________________________________
From: Nilsson, Claes1 [Claes1.Nilsson@sonymobile.com]
Sent: Tuesday, April 23, 2013 22:41
To: 'Jonas Sicking'; Christophe Dumez - SISA
Cc: public-sysapps@w3.org; Edenbrandt, Anders; "Ekberg, Björn"; Falk, Mattias; Isberg, Anders
Subject: RE: [sysapps/raw socket api]: New version based on Madrid meeting comments and comments from Ke-Fong Lin

Hi,

I have stated in the description of the TCPOptions dictionary the following:
“States the options for the TCPSocket. An instance of this dictionary is used in the constructor of the TCPSocket object, where the remoteAddress and remotePort fields are required, all other fields are optional.”
The remoteAddress and remotePort attributes are not nullable but the other are nullable.

Step 1 of the description of the TCPSocket<http://raw-sockets.sysapps.org/#idl-def-TCPSocket> constructor invocation states “If the options.remoteAddress argument is not a valid IPv4/6 address or the options.remotePort argument is not a valid port number then throw an InvalidAccessError exception and abort these steps, …”

However, this pattern may still not be 100% correct and clear. So what about the following proposal:


·        Don’t have any dictionary fields nullable as this probably does not add anything. If a field is not present the default value is used so the fields do not have to be nullable.

·        For the TCP Socket constructor have remoteAddress and remotePort are separate mandatory arguments and the remaining optional stuff in the optional options argument, which is of type TCPOptions dicionary (where  remoteAddress and remotePort are removed).

·        The UDPSocket and TCPServerSocket constructors just have one optional argument, i.e. options of type  UDPOptions/TCPServerOptions dictionary.

·        For the three socket interfaces add a number of readonly attributes instead of using UDP/TCP/TCPServerOptions dictionary as type for one single “options”attribute (which apparently is incorrect WebIDL as Christophe points out)

WDYT?

Claes

From: Jonas Sicking [mailto:jonas@sicking.cc]
Sent: den 23 april 2013 19:53
To: Christophe Dumez - SISA
Cc: Nilsson, Claes1; public-sysapps@w3.org; Edenbrandt, Anders; Ekberg, Björn; Falk, Mattias; Isberg, Anders
Subject: Re: [sysapps/raw socket api]: New version based on Madrid meeting comments and comments from Ke-Fong Lin

Yup, as written they are optional.

What we can and should do is to use prose to say that an exception is thrown if either of them is left out when the constructor is called.
And you are right about the '?' syntax. That means that the argument is nullable which is likely not what we want in the majority of cases here. So I think it should be removed from most, if not all, dictionary members.
/ Jonas

On Tue, Apr 23, 2013 at 7:45 AM, Christophe Dumez - SISA <ch.dumez@partner.samsung.com<mailto:ch.dumez@partner.samsung.com>> wrote:
Hi,

As far as I know, all dictionary members are optional. I think you may be confusing nullable and optional? It is true that they are currently not nullable, however, I do believe they are optional.

Kr,
Christophe DUMEZ.
________________________________
From: Nilsson, Claes1 [Claes1.Nilsson@sonymobile.com<mailto:Claes1.Nilsson@sonymobile.com>]
Sent: Tuesday, April 23, 2013 17:33
To: Christophe Dumez - SISA; public-sysapps@w3.org<mailto:public-sysapps@w3.org>

Cc: Edenbrandt, Anders; "Ekberg, Björn"; Falk, Mattias; Isberg, Anders
Subject: RE: [sysapps/raw socket api]: New version based on Madrid meeting comments and comments from Ke-Fong Lin

Hi Christophe,

No, remoteAddress and remotePort are not optional. The options argument of type TCPOptions in the constructor is mandatory and the fields remoteAddress and remotePort fields are required.

However, you are right that the WebIDL specification does not allowed as attribute types. I missed that.

One option is just to extract the fields from the dictionaries and add them as separate attributes but maybe someone has a proposal for a better pattern?

BR
  Claes


From: Christophe Dumez - SISA [mailto:ch.dumez@partner.samsung.com<mailto:ch.dumez@partner.samsung.com>]
Sent: den 23 april 2013 15:54
To: Nilsson, Claes1; public-sysapps@w3.org<mailto:public-sysapps@w3.org>
Cc: Edenbrandt, Anders; Ekberg, Björn; Falk, Mattias; Isberg, Anders
Subject: RE: [sysapps/raw socket api]: New version based on Madrid meeting comments and comments from Ke-Fong Lin

Hi Claes,

I thought we agreed during last F2F to pass the remoteAddress and remotePort as argument to the TCPSocket constructor, instead of having them in the TCPOptions dictionary?

The issue with having remoteAddress and remotePort in the TCPOptions dictionary is that they are now optional. However, those need to be provided for the TCPSocket to work.

Also note that having interface attributes of Dictionary types such as UDPSocket.options, TCPSocket.options and TCPServerSocket.options is not valid in Web IDL [1].

Kr,
Christophe DUMEZ.

[1] http://dev.w3.org/2006/webapi/WebIDL/#idl-dictionaries
    "Dictionaries MUST NOT be used as the type of an attribute<http://dev.w3.org/2006/webapi/WebIDL/#dfn-attribute>, constant<http://dev.w3.org/2006/webapi/WebIDL/#dfn-constant> or exception field<http://dev.w3.org/2006/webapi/WebIDL/#dfn-exception-field>. "
________________________________
From: Nilsson, Claes1 [Claes1.Nilsson@sonymobile.com<mailto:Claes1.Nilsson@sonymobile.com>]
Sent: Tuesday, April 23, 2013 16:35
To: public-sysapps@w3.org<mailto:public-sysapps@w3.org>
Cc: Edenbrandt, Anders; "Ekberg, Björn"; Falk, Mattias; Isberg, Anders
Subject: [sysapps/raw socket api]: New version based on Madrid meeting comments and comments from Ke-Fong Lin
See http://raw-sockets.sysapps.org/

Is this version now ready for a CFC for FPWD?

Updates according to SysApps Madrid meeting 2013-04-09 and comments by Ke-Fong Lin (thanks a lot!):

* For reading simplicity the API is restructured so that there are three main interfaces according to below:
- interface UDPSocket : EventTarget
- interface TCPSocket : EventTarget
- interface TCPServerSocket : EventTarget
* Syntax and semantics as much as possible aligned with W3C Web Sockets.
* UDPSocket: Updated constructor to optionally use UDPOptions dictionary and extended the dictionary with fields for default remote address and port.
* UDPSocket: Added joinMulticastGroup() and leaveMulticastGroup() methods
* UDPSocket: Added an explicit method for closing a UDP socket
* TCPSocket: Added method halfClose() and event for when peer has done hlf close.
* UDP and TCPSockets: Aligned sending data with Web Sockets using 4 overloading methods for different data types of outgoing data.
* UDP and TCPSockets: Implementation dependent limit for when send() returns false indicating that send buffer is near getting full. If buffer full an error event is issued consistent with Web Sockets.
* UDP and TCPSockets: Data type for received data is always ArrayBuffer. Atribute binaryType removed.
* TCPServerSocket: Added methods suspend() and resume().

Still to be done:

* More work needed on support for secure sockets.
* More UDP examples and potentially remove SSDP examples.


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

Sony Mobile Communications
Tel: +46 705 56 68 78<tel:%2B46%20705%2056%2068%2078>
sonymobile.com<http://sonymobile.com/>

Received on Tuesday, 23 April 2013 19:46:36 UTC