Packagecom.electrotank.electroserver4.message.event
Classpublic class ConnectionEvent
InheritanceConnectionEvent Inheritance EventImpl Inheritance MessageImpl

When the client tries to establish a new text or binary socket a ConnectionEvent is eventually fired. If the connection is successful then the getAccepted() method returns true.


Example
This shows how to listen for the ConnectionEvent.
    import com.electrotank.electroserver4.ElectroServer;
    import com.electrotank.electroserver4.message.MessageType;
    import com.electrotank.electroserver4.message.event.ConnectionEvent;
    //
    var es:ElectroServer;
    es.addEventListener(MessageType.ConnectionEvent, "onConnectionEvent", this);
    function onConnectionEvent(e:ConnectionEvent):void {
        trace("connection established: "+e.getAccepted());
    }
         



Public Properties
 PropertyDefined by
  success : Boolean
[read-only] Returns true if the connection was a success.
ConnectionEvent
 Inheritedtarget : Object
MessageImpl
 Inheritedtype : String
MessageImpl
Public Methods
 MethodDefined by
  
Creates a new instance of the ConnectionEvent class.
ConnectionEvent
  
getAccepted():Boolean
Returns true if the connection was a success.
ConnectionEvent
  
getBase():String
Gets the base.
ConnectionEvent
  
Gets the EsError.
ConnectionEvent
  
getHashId():int
ConnectionEvent
 Inherited
Used internally when one client-request needs to be remapped to a server request.
MessageImpl
 Inherited
getMessageId():Number
The id of the message.
MessageImpl
 Inherited
The type of message being used.
MessageImpl
  
getPrime():String
Gets the prime.
ConnectionEvent
 Inherited
If this is not a real message, then get it.
MessageImpl
  
setHashId(hashId:int):void
ConnectionEvent
 Inherited
setIsRealServerMessage(isRealServerMessage:Boolean):void
Used internally when one client-request needs to be remapped to a server request.
MessageImpl
 Inherited
setMessageId(id:Number):void
The id of the message.
MessageImpl
 Inherited
This defines the type of message being used, such as LoginRequest or CreateRoomVariableRequest.
MessageImpl
  
toString():String
ConnectionEvent
 Inherited
Every messages have varying optional fields.
MessageImpl
Property detail
successproperty
success:Boolean  [read-only]

Returns true if the connection was a success.

Implementation
    public function get success():Boolean
Constructor detail
ConnectionEvent()constructor
public function ConnectionEvent()

Creates a new instance of the ConnectionEvent class.

Method detail
getAccepted()method
public function getAccepted():Boolean

Returns true if the connection was a success.

Returns
Boolean — True or false.
getBase()method 
public function getBase():String

Gets the base.

Returns
String — The base.
getEsError()method 
public function getEsError():EsError

Gets the EsError. If the connection failed then there will be an EsError.

Returns
EsError — The EsError.
getHashId()method 
public function getHashId():int

Returns
int
getPrime()method 
public function getPrime():String

Gets the prime.

Returns
String — The prime.
setHashId()method 
public function setHashId(hashId:int):voidParameters
hashId:int
toString()method 
public function toString():String

Returns
String