W3C home > Mailing lists > Public > www-svg@w3.org > November 2004

B.2.3 Socket Connections

From: Jan-Klaas Kollhof <jan@kollhof.net>
Date: Wed, 24 Nov 2004 14:07:18 +0100
Message-ID: <41A48786.4020501@kollhof.net>
To: www-svg@w3.org


here the proposal for the Socket Connection section.

Jan-Klaas Kollhof

B.2.3 Socket Connections

The Connection interface provides an API for socket-level communication.
A Connection object is created using the SVGGlobal interface 'createConnection()'.
After a connection has been established using the 'connect()' method the
Connection object must dispatch a 'ConnectionConnected' event.  In the
circumstance that the connection is closed by any peer, a 'ConnectionClosed'
event must be dispatched. A 'ConnectionError' event must be dispatched in
case of any error and should give information about the error in the event's
'data' attribute.

Upon data reception, the Connection object must dispatch a 'ConnectionData'
event. The event's 'data' attribute must contain the data received.
The Connection object must support the following encoding: UTF-8/16LE and UTF-16BE
The default encoding is UTF-16 and may be reset using 'setEncoding()' at any time.
All data sent must be encoded using the currently set encoding.
Data received is interpreted as being data in the same encoding as set for the Connection object.

Raw byte data encoding:

For sending byte data, the lower 8 bits of each character's charcode is sent.
Arriving data must be interpreted such that each byte arriving represents the
charcode for a single character in the resulting data attribute of the
'ConnectionData' event. 

interface ConnectionEvent : events::Event {
    //target attribute must be a reference to the Connection object 

interface ConnectionData : ConnectionEvent {
    readonly attribute DOMString data;

interface ConnectionClosed : ConnectionEvent { 

interface ConnectionError : ConnectionEvent {
    readonly attribute DOMString data;  // Error data 

interface ConnectionConnected : ConnectionEvent { 


interface Connection : events::EventTarget {
    readonly attribute boolean connected;
    void setEncoding(DOMString value);   //may be called before connect
    void connect( in DOMString url ) raises(DOMException)  // e.g.,  some-server.xyz:80
    void send( in DOMString data );
    void close();


 Jan-Klaas Kollhof
 Founding Partner, Vectoreal
 phone: +49 174 968 9477
 email: jan@kollhof.net
 web: http://jan.kollhof.net
Received on Wednesday, 24 November 2004 13:03:51 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:01 UTC