Packagecom.electrotank.electroserver4.connection
Classpublic class HttpConnection
InheritanceHttpConnection Inheritance AbstractConnection Inheritance Observable

This class is used internally to the ElectroServer class. When you want to create a new HTTP connection use ElectroServer.createHttpConnection. This class is used to handle binary-based socket connections to the server.



Public Properties
 PropertyDefined by
  retryCount : uint
Get the number of times to retry on a failure to send a message.
HttpConnection
  retryDelay : uint
Get the delay between retries in milliseconds
HttpConnection
Public Methods
 MethodDefined by
  
HttpConnection(ip:String, port:Number, es:ElectroServer)
Creates a new instance of the HttpConnection class.
HttpConnection
 Inherited
addEventListener(mt:MessageType, funcName:String, scope:Object, first:Boolean = false):void
Observable
 Inherited
addListener(ob:Object):void
Observable
  
addWorker(worker:HttpWorker):void
Add worker object to handle connection communications.
HttpConnection
 Inherited
close():void
Closes the connection to the server.
AbstractConnection
  
connect():void
Attempts to connect to the ip and port specified.
HttpConnection
 Inherited
dispatchEvent(eventOb:MessageImpl):void
Observable
 Inherited
Gets the next expected inbound id.
AbstractConnection
 Inherited
getId():Number
Gets the connection id.
AbstractConnection
 Inherited
getIp():String
Gets the ip used.
AbstractConnection
 Inherited
getIsConnected():Boolean
Returns true if connected, false if not.
AbstractConnection
 Inherited
Gets the next outbound id.
AbstractConnection
 Inherited
getPort():Number
Gets the port used.
AbstractConnection
 Inherited
getProtocol():String
Gets the connection protocol.
AbstractConnection
  
log(o:Object):void
[static] Timestamped output of object.
HttpConnection
 Inherited
notifyListeners(eventName:String, eventOb:Object):void
Observable
  
Event fired upon connection attempt.
HttpConnection
 Inherited
onPreClose():void
Used internally to tell whoever is listening that a connection close is happening.
AbstractConnection
 Inherited
onPreConnect(success:Boolean):void
Used internally to send an event to whoever is listening.
AbstractConnection
 Inherited
removeEventListener(mt:MessageType, funcName:String, scope:Object):void
Observable
 Inherited
removeListener(ob:Object):void
Observable
  
removeWorker(worker:HttpWorker):void
Remove worker object that is handling connection communications.
HttpConnection
 Inherited
send(message:String):void
Sends a message to the server.
AbstractConnection
  
sendBinary(message:ByteArray):void
Sends a message to the server.
HttpConnection
 Inherited
setExpectedInboundId(id:Number):void
Sets the next expected inbound id.
AbstractConnection
 Inherited
setId(id:Number):void
Sets the connection id.
AbstractConnection
Protected Methods
 MethodDefined by
  
doClose():void
Closes the connection to the server.
HttpConnection
Property detail
retryCountproperty
retryCount:uint  [read-write]

Get the number of times to retry on a failure to send a message.

Implementation
    public function get retryCount():uint
    public function set retryCount(value:uint):void
retryDelayproperty 
retryDelay:uint  [read-write]

Get the delay between retries in milliseconds

Implementation
    public function get retryDelay():uint
    public function set retryDelay(value:uint):void
Constructor detail
HttpConnection()constructor
public function HttpConnection(ip:String, port:Number, es:ElectroServer)

Creates a new instance of the HttpConnection class.

Parameters
ip:String — The ip to connect to.
 
port:Number — The port to use.
 
es:ElectroServer — The instance of the ElectroServer object that you want to attach the HttpConnection to.
Method detail
addWorker()method
public function addWorker(worker:HttpWorker):void

Add worker object to handle connection communications.

Parameters
worker:HttpWorker — HttpWorker object.
connect()method 
public override function connect():void

Attempts to connect to the ip and port specified.

doClose()method 
protected override function doClose():void

Closes the connection to the server.

log()method 
public static function log(o:Object):void

Timestamped output of object.

Parameters
o:Object — Object to dump.
onConnectionEvent()method 
public function onConnectionEvent(e:ConnectionEvent):void

Event fired upon connection attempt.

Parameters
e:ConnectionEvent
removeWorker()method 
public function removeWorker(worker:HttpWorker):void

Remove worker object that is handling connection communications.

Parameters
worker:HttpWorker — HttpWorker object.
sendBinary()method 
public override function sendBinary(message:ByteArray):void

Sends a message to the server.

Parameters
message:ByteArray — The message to send.