Packagenet.user1.reactor
Classpublic class XMLSocketConnection
InheritanceXMLSocketConnection Inheritance Connection Inheritance flash.events.EventDispatcher

Since : Reactor 1.0.0

The XMLSocketConnection class is used by Reactor to communicate with Union Server over a persistent TCP/IP socket. Normally, developers need not use the XMLSocketConnection class directly, and should instead make connections via the Reactor class's connect() method. However, the XMLSocketConnection class is required for fine-grained connection configuration, such as defining failover socket connections for multiple Union servers running at different host addresses (see the example in the ConnectionManager's main class entry).

By default, Reactor uses XMLSocketConnection connections to communicate with Union Server. XMLSocketConnection connections offer faster response times than HTTP connections, but occupy an operating-system-level socket continuously for the duration of the connection. If an XMLSocketConnection connection cannot be established (due to, say, a restrictive firewall), Reactor automatically attempts to communicate using HTTP requests sent via an HTTPConnection. Developers can override Reactor's default connection failover system by manually configuring connections using the ConnectionManager class and Reactor's disableHTTPFailover() method.

See also

Reactor.connect()
Reactor.disableHTTPFailover()
HTTPConnection
ConnectionManager


Public Methods
 MethodDefined By
  
XMLSocketConnection(host:String, port:int = 80)
XMLSocketConnection
  
connect():void
[override] For documentation, see IConnection's connect() method.
XMLSocketConnection
 Inherited
disconnect():void
For documentation, see IConnection's disconnect() method.
Connection
  
dispose():void
[override] Permanently disables this XMLSocketConnection.
XMLSocketConnection
 Inherited
getHost():String
For documentation, see IConnection's getHost() method.
Connection
 Inherited
getPort():int
For documentation, see IConnection's getPort() method.
Connection
 Inherited
Returns an integer indicating the number of times this Connection object has successfully achieved a ready state.
Connection
 Inherited
For documentation, see IConnection's getRequestedHost() method.
Connection
 Inherited
getType():String
For documentation, see IConnection's getType() method.
Connection
 Inherited
isReady():Boolean
For documentation, see IConnection's isReady() method.
Connection
 Inherited
isValid():Boolean
For documentation, see IConnection's isValid() method.
Connection
  
send(data:*):void
[override] For documentation, see IConnection's send() method.
XMLSocketConnection
 Inherited
setReactor(reactor:Reactor):void
Connection
 Inherited
setServer(host:String, port:int):void
For documentation, see IConnection's setServer() method.
Connection
 Inherited
toString():String
[override]
Connection
Events
 Event Summary Defined By
 Inherited Dispatched when a connection attempt by an IConnection object begins.Connection
 Inherited Dispatched when an IConnection object initiates the "handshake" phase of a Union Server connection.Connection
 Inherited Dispatched when an IConnection object's connection to the server is closed by the client.Connection
 Inherited Dispatched when a connection attempt by an IConnection object fails.Connection
 Inherited Dispatched when an IConnection object achieves a fully initialized connection to the server.Connection
 Inherited Dispatched whenever any data is received from Union Server by an IConnection object.Connection
   Dispatched when a UPC-formatted message is received by an IConnection object.XMLSocketConnection
 Inherited Dispatched whenever any data is sent to Union Server over an IConnection object.Connection
 Inherited Dispatched when an IConnection object's connection to the server is closed by the server.Connection
 Inherited Dispatched when Union Server informs the client that a session id used in a message from the client refers to an unknown session.Connection
 Inherited Dispatched when Union Server informs the client that its session has been terminated.Connection
Constructor Description
XMLSocketConnection()Constructor
public function XMLSocketConnection(host:String, port:int = 80)



Parameters
host:String
 
port:int (default = 80)
Method Descriptions
connect()method
override public function connect():void

Since : Reactor 1.0.0

For documentation, see IConnection's connect() method.

See also

dispose()method 
override public function dispose():void

Since : Reactor 1.0.0

Permanently disables this XMLSocketConnection.

send()method 
override public function send(data:*):void

Since : Reactor 1.0.0

For documentation, see IConnection's send() method.

Parameters

data:*

See also

Event Detail
RECEIVE_UPC Event
Event Object Type: ConnectionEvent
ConnectionEvent.type variable = net.user1.reactor.ConnectionEvent.RECEIVE_UPC

Dispatched when a UPC-formatted message is received by an IConnection object.

See also