| Package | com.electrotank.electroserver4.connection |
| Class | public class AbstractConnection |
| Inheritance | AbstractConnection Observable |
| Subclasses | Connection, HttpConnection |
| Method | Defined by | ||
|---|---|---|---|
|
AbstractConnection(ip:String, port:Number, protocol:String)
Creates a new instance of the AbstractConnection class.
| AbstractConnection | ||
![]() |
addEventListener(mt:MessageType, funcName:String, scope:Object, first:Boolean = false):void
| Observable | |
![]() |
addListener(ob:Object):void
| Observable | |
|
close():void
Closes the connection to the server.
| AbstractConnection | ||
|
connect():void
Attempts to connect to the ip and port specified.
| AbstractConnection | ||
![]() |
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 | ||
![]() |
notifyListeners(eventName:String, eventOb:Object):void
| Observable | |
|
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 | |
|
send(message:String):void
Sends a message to the server.
| AbstractConnection | ||
|
sendBinary(ba:ByteArray):void
Sends a message to the server.
| AbstractConnection | ||
|
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
Must be implemented in a new inherited class.
| AbstractConnection | ||
| AbstractConnection | () | constructor |
public function AbstractConnection(ip:String, port:Number, protocol:String)Creates a new instance of the AbstractConnection class.
Parametersip:String — The ip to connect to.
|
|
port:Number — The port to use.
|
|
protocol:String — The protocol to use.
|
See also
| close | () | method |
public final function close():voidCloses the connection to the server.
| connect | () | method |
public function connect():voidAttempts to connect to the ip and port specified.
| doClose | () | method |
protected function doClose():voidMust be implemented in a new inherited class.
| getExpectedInboundId | () | method |
public function getExpectedInboundId():NumberGets the next expected inbound id.
ReturnsNumber — The next expected inbound id.
|
| getId | () | method |
public function getId():NumberGets the connection id.
ReturnsNumber — The connection id.
|
| getIp | () | method |
public function getIp():StringGets the ip used.
ReturnsString — The ip used.
|
| getIsConnected | () | method |
public function getIsConnected():BooleanReturns true if connected, false if not.
ReturnsBoolean — True or false.
|
| getNextOutboundId | () | method |
public function getNextOutboundId():NumberGets the next outbound id.
ReturnsNumber — The next outbound id.
|
| getPort | () | method |
public function getPort():NumberGets the port used.
ReturnsNumber — The port used.
|
| getProtocol | () | method |
public function getProtocol():StringGets the connection protocol.
ReturnsString — The connection protocol.
|
| onPreClose | () | method |
public function onPreClose():voidUsed internally to tell whoever is listening that a connection close is happening.
| onPreConnect | () | method |
public function onPreConnect(success:Boolean):voidUsed internally to send an event to whoever is listening.
Parameterssuccess:Boolean — True or false.
|
| send | () | method |
public function send(message:String):voidSends a message to the server.
Parametersmessage:String — message to send.
|
| sendBinary | () | method |
public function sendBinary(ba:ByteArray):voidSends a message to the server.
Parametersba:ByteArray — The message to send.
|
| setExpectedInboundId | () | method |
public function setExpectedInboundId(id:Number):voidSets the next expected inbound id.
Parametersid:Number — The next inbound id to expect.
|
| setId | () | method |
public function setId(id:Number):voidSets the connection id.
Parametersid:Number — The connection id.
|