| Package | com.electrotank.electroserver4.connection |
| Class | public class HttpConnection |
| Inheritance | HttpConnection AbstractConnection Observable |
| Property | Defined 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 | ||
| Method | Defined by | ||
|---|---|---|---|
|
HttpConnection(ip:String, port:Number, es:ElectroServer)
Creates a new instance of the HttpConnection class.
| HttpConnection | ||
![]() |
addEventListener(mt:MessageType, funcName:String, scope:Object, first:Boolean = false):void
| Observable | |
![]() |
addListener(ob:Object):void
| Observable | |
|
addWorker(worker:HttpWorker):void
Add worker object to handle connection communications.
| HttpConnection | ||
![]() |
close():void
Closes the connection to the server.
| AbstractConnection | |
|
connect():void
Attempts to connect to the ip and port specified.
| HttpConnection | ||
![]() |
dispatchEvent(eventOb:MessageImpl):void
| Observable | |
![]() |
getExpectedInboundId():Number
Gets the next expected inbound id.
| AbstractConnection | |
![]() |
getId():Number
Gets the connection id.
| AbstractConnection | |
![]() |
getIp():String
Gets the ip used.
| AbstractConnection | |
![]() |
getIsConnected():Boolean
Returns true if connected, false if not.
| AbstractConnection | |
![]() |
getNextOutboundId():Number
Gets the next outbound id.
| AbstractConnection | |
![]() |
getPort():Number
Gets the port used.
| AbstractConnection | |
![]() |
getProtocol():String
Gets the connection protocol.
| AbstractConnection | |
|
log(o:Object):void
[static]
Timestamped output of object.
| HttpConnection | ||
![]() |
notifyListeners(eventName:String, eventOb:Object):void
| Observable | |
|
onConnectionEvent(e:ConnectionEvent):void
Event fired upon connection attempt.
| HttpConnection | ||
![]() |
onPreClose():void
Used internally to tell whoever is listening that a connection close is happening.
| AbstractConnection | |
![]() |
onPreConnect(success:Boolean):void
Used internally to send an event to whoever is listening.
| AbstractConnection | |
![]() |
removeEventListener(mt:MessageType, funcName:String, scope:Object):void
| Observable | |
![]() |
removeListener(ob:Object):void
| Observable | |
|
removeWorker(worker:HttpWorker):void
Remove worker object that is handling connection communications.
| HttpConnection | ||
![]() |
send(message:String):void
Sends a message to the server.
| AbstractConnection | |
|
sendBinary(message:ByteArray):void
Sends a message to the server.
| HttpConnection | ||
![]() |
setExpectedInboundId(id:Number):void
Sets the next expected inbound id.
| AbstractConnection | |
![]() |
setId(id:Number):void
Sets the connection id.
| AbstractConnection | |
| Method | Defined by | ||
|---|---|---|---|
|
doClose():void
Closes the connection to the server.
| HttpConnection | ||
| retryCount | property |
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
| retryDelay | property |
retryDelay:uint [read-write]Get the delay between retries in milliseconds
Implementation public function get retryDelay():uint
public function set retryDelay(value:uint):void
| HttpConnection | () | constructor |
public function HttpConnection(ip:String, port:Number, es:ElectroServer)Creates a new instance of the HttpConnection class.
Parametersip: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.
|
| addWorker | () | method |
public function addWorker(worker:HttpWorker):voidAdd worker object to handle connection communications.
Parametersworker:HttpWorker — HttpWorker object.
|
| connect | () | method |
public override function connect():voidAttempts to connect to the ip and port specified.
| doClose | () | method |
protected override function doClose():voidCloses the connection to the server.
| log | () | method |
public static function log(o:Object):voidTimestamped output of object.
Parameterso:Object — Object to dump.
|
| onConnectionEvent | () | method |
public function onConnectionEvent(e:ConnectionEvent):voidEvent fired upon connection attempt.
Parameterse:ConnectionEvent |
| removeWorker | () | method |
public function removeWorker(worker:HttpWorker):voidRemove worker object that is handling connection communications.
Parametersworker:HttpWorker — HttpWorker object.
|
| sendBinary | () | method |
public override function sendBinary(message:ByteArray):voidSends a message to the server.
Parametersmessage:ByteArray — The message to send.
|