1 /** @file oils_transport.js
2 * Houses the top level transport 'abstract' classes
3 * You can think of this like a header file which provides the
4 * interface that any transport code must implement
8 // ------------------------------------------------------------------
9 // TRANSPORT_CONNECTION
12 function transport_connection( username, password, resource ) { }
14 /** Connects to the transport host */
15 transport_connection.prototype.connect = function( host, /*int*/ port, /*int*/ timeout ) {}
17 /** Sends a new message to recipient, with session_id and body */
18 transport_connection.prototype.send = function( recipient, session_id, body ) {}
21 /** Returns a transport_message. This function will return
22 * immediately if there is a message available. Otherwise, it will
23 * wait at most 'timeout' seconds for one to arrive. Returns
24 * null if a message does not arrivae in time.
26 * 'timeout' is specified in milliseconds
28 transport_connection.prototype.recv = function( /*int*/ timeout ) {}
30 /** This method calls recv and then passes the contents on to the
31 * message processing stack.
33 transport_connection.prototype.process_msg = function( /*int*/ timeout ) {
34 var msg = this.recv( timeout );
35 if( msg ) { Transport.handler( msg ); }
38 /** Disconnects from the transpot host */
39 transport_connection.prototype.disconnect = function() {}
41 /** Returns true if this connection instance is currently connected
42 * to the transport host.
44 transport_connection.prototype.connected = function() {}
48 // ------------------------------------------------------------------
53 function transport_message( sender, recipient, session_id, body ) {}
55 /** Returns the sender of the message */
56 transport_message.prototype.get_sender = function() {}
58 /** Returns the session id */
59 transport_message.prototype.get_session = function() {}
61 /** Returns the message body */
62 transport_message.prototype.get_body = function() {}