WebSocket provides a text-based socket abstraction for ActionScript.
bufferedAmount:int [read-only]
The number of bytes queued to be sent.
Implementation
public function get bufferedAmount():int
public var onclose:Function
The onclose handler is called when the connection is terminated.
public var onmessage:Function
The omessage handler is called when data arrives.
public var onopen:Function
The onopen handler is called when the connection is established.
protocol:String [read-only]
The subprotocol selected by the server, if any.
Implementation
public function get protocol():String
readyState:Number [read-only]
The ready state indicates the connection status.
Implementation
public function get readyState():Number
URL:String [read-only]
The URL with which the WebSocket was constructed.
Implementation
public function get URL():String
public function WebSocket(location:String, protocol:String = null)Parameters
| location:String |
| |
| protocol:String (default = null) |
public function close(code:int = 0, reason:String = ""):void
Disconnects the remote socket location.
Parameters
| code:int (default = 0) |
| |
| reason:String (default = "") |
public function handleClose(event:CloseEvent):voidParameters
public function handleError(event:Event):voidParameters
public function handleMessage(event:MessageEvent):voidParameters
public function handleOpen(event:Event):voidParameters
public function send(data:*):void
Sends text-based data to the remote socket location.
Parameters
| data:* — data the data payload
|
Event object type: CloseEvent
Dispatched when the connection is terminated.
Event object type: MessageEvent
Dispatched when data arrives.
Event object type: flash.events.Event
Dispatched when the connection is established.