Packagenet.user1.reactor
Classpublic class ConnectionEvent
InheritanceConnectionEvent Inheritance flash.events.Event

Since : Reactor 1.0.0

ConnectionEvent is a simple data class used to pass information about a connection event to registered event-listeners. The ConnectionEvent class also defines constants representing the available connection events.

See also

XMLSocketConnection
HTTPConnection
ConnectionManagerEvent


Public Methods
 MethodDefined By
  
ConnectionEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, u:XML = null, data:Object = null, connection:IConnection = null, status:String = null)
Initializes a new ConnectionEvent object.
ConnectionEvent
  
clone():Event
[override]
ConnectionEvent
  
getData():Object
Returns the data that was sent or received by the connection.
ConnectionEvent
  
getStatus():String
Returns the status of the event.
ConnectionEvent
  
getUPC():XML
Returns the UPC message that was received by the connection, as an instance of ActionScript's built-in XML class.
ConnectionEvent
  
toString():String
[override]
ConnectionEvent
Public Constants
 ConstantDefined By
  BEGIN_CONNECT : String = BEGIN_CONNECT
[static] Dispatched when a connection attempt by an IConnection object begins.
ConnectionEvent
  BEGIN_HANDSHAKE : String = BEGIN_HANDSHAKE
[static] Dispatched when an IConnection object initiates the "handshake" phase of a Union Server connection.
ConnectionEvent
  CLIENT_KILL_CONNECT : String = CLIENT_KILL_CONNECT
[static] Dispatched when an IConnection object's connection to the server is closed by the client.
ConnectionEvent
  CONNECT_FAILURE : String = CONNECT_FAILURE
[static] Dispatched when a connection attempt by an IConnection object fails.
ConnectionEvent
  DISCONNECT : String = DISCONNECT
[static] Dispatched when an IConnection object's connection to the server is closed.
ConnectionEvent
  READY : String = READY
[static] Dispatched when an IConnection object achieves a fully initialized connection to the server.
ConnectionEvent
  RECEIVE_DATA : String = RECEIVE_DATA
[static] Dispatched whenever any data is received from Union Server by an IConnection object.
ConnectionEvent
  RECEIVE_UPC : String = RECEIVE_UPC
[static] Dispatched when a UPC-formatted message is received by an IConnection object.
ConnectionEvent
  SEND_DATA : String = SEND_DATA
[static] Dispatched whenever any data is sent to Union Server over an IConnection object.
ConnectionEvent
  SERVER_KILL_CONNECT : String = SERVER_KILL_CONNECT
[static] Dispatched when an IConnection object's connection to the server is closed by the server.
ConnectionEvent
  SESSION_NOT_FOUND : String = SESSION_NOT_FOUND
[static] Dispatched when Union Server informs the client that a session id used in a message from the client refers to an unknown session.
ConnectionEvent
  SESSION_TERMINATED : String = SESSION_TERMINATED
[static] Dispatched when Union Server informs the client that its session has been terminated.
ConnectionEvent
Constructor Description
ConnectionEvent()Constructor
public function ConnectionEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, u:XML = null, data:Object = null, connection:IConnection = null, status:String = null)

Since : Reactor 1.0.0

Initializes a new ConnectionEvent object.

Parameters
type:String
 
bubbles:Boolean (default = false)
 
cancelable:Boolean (default = false)
 
u:XML (default = null)
 
data:Object (default = null)
 
connection:IConnection (default = null)
 
status:String (default = null)
Method Descriptions
clone()method
override public function clone():Event

Returns
Event
getData()method 
public function getData():Object

Since : Reactor 1.0.0

Returns the data that was sent or received by the connection. The getData() method is available for the ConnectionEvent.SEND_DATA and ConnectionEvent.RECEIVE_DATA event only.

Returns
Object

See also

getStatus()method 
public function getStatus():String

Since : Reactor 1.0.0

Returns the status of the event. The getStatus() method is available for the ConnectionEvent.CONNECT_FAILURE event only.

Returns
String

See also

getUPC()method 
public function getUPC():XML

Since : Reactor 1.0.0

Returns the UPC message that was received by the connection, as an instance of ActionScript's built-in XML class. The getUPC() method is an internal tool used by MessageManager to extract information from UPC formatted messages. It is rarely, if ever, required by Union client developers. The getUPC() method is available for the ConnectionEvent.RECEIVE_UPC event only.

Returns
XML

See also

toString()method 
override public function toString():String

Returns
String
Constant Descriptions
BEGIN_CONNECTConstant
public static const BEGIN_CONNECT:String = BEGIN_CONNECT

Since : Reactor 1.0.0

Dispatched when a connection attempt by an IConnection object begins. The ConnectionEvent.BEGIN_CONNECT event is followed by either a ConnectionEvent.BEGIN_HANDSHAKE event or a ConnectionEvent.CONNECT_FAILURE event. It indicates that the individual IConnection object has started an attempt to connect to Union Server.

See also

BEGIN_HANDSHAKEConstant 
public static const BEGIN_HANDSHAKE:String = BEGIN_HANDSHAKE

Since : Reactor 1.0.0

Dispatched when an IConnection object initiates the "handshake" phase of a Union Server connection. During the handshake phase, the connection identifies the client to the server by sending a CLIENT_HELLO UPC message, and then waits for the server's response. If the connection is successfully initialized, the ConnectionEvent.READY event will follow. If not, the ConnectionEvent.CONNECT_FAILURE event will follow.

See also

CLIENT_KILL_CONNECTConstant 
public static const CLIENT_KILL_CONNECT:String = CLIENT_KILL_CONNECT

Since : Reactor 1.0.0

Dispatched when an IConnection object's connection to the server is closed by the client. The ConnectionEvent.CLIENT_KILL_CONNECT event is always followed by the ConnectionEvent.DISCONNECT event.

CONNECT_FAILUREConstant 
public static const CONNECT_FAILURE:String = CONNECT_FAILURE

Since : Reactor 1.0.0

Dispatched when a connection attempt by an IConnection object fails. Common causes of connection failures are:

See also

DISCONNECTConstant 
public static const DISCONNECT:String = DISCONNECT

Since : Reactor 1.0.0

Dispatched when an IConnection object's connection to the server is closed. The ConnectionEvent.DISCONNECT is always preceded by either the ConnectionEvent.CLIENT_KILL_CONNECT event or the ConnectionEvent.SERVER_KILL_CONNECT, which indicate whether the client or server instigated the disconnection.

READYConstant 
public static const READY:String = READY

Since : Reactor 1.0.0

Dispatched when an IConnection object achieves a fully initialized connection to the server. As a convenience, the ConnectionEvent.READY event, in turn, triggers a ConnectionManagerEvent.READY event, which triggers a ReactorEvent.READY event.

See also

RECEIVE_DATAConstant 
public static const RECEIVE_DATA:String = RECEIVE_DATA

Since : Reactor 1.0.0

Dispatched whenever any data is received from Union Server by an IConnection object.

RECEIVE_UPCConstant 
public static const RECEIVE_UPC:String = RECEIVE_UPC

Since : Reactor 1.0.0

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

SEND_DATAConstant 
public static const SEND_DATA:String = SEND_DATA

Since : Reactor 1.0.0

Dispatched whenever any data is sent to Union Server over an IConnection object.

SERVER_KILL_CONNECTConstant 
public static const SERVER_KILL_CONNECT:String = SERVER_KILL_CONNECT

Since : Reactor 1.0.0

Dispatched when an IConnection object's connection to the server is closed by the server. The ConnectionEvent.SERVER_KILL_CONNECT event is always followed by the ConnectionEvent.DISCONNECT event.

SESSION_NOT_FOUNDConstant 
public static const SESSION_NOT_FOUND:String = SESSION_NOT_FOUND

Since : Reactor 1.0.0

Dispatched when Union Server informs the client that a session id used in a message from the client refers to an unknown session.

SESSION_TERMINATEDConstant 
public static const SESSION_TERMINATED:String = SESSION_TERMINATED

Since : Reactor 1.0.0

Dispatched when Union Server informs the client that its session has been terminated.