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