Packagecom.kaazing.gateway.client.html5
Classpublic class ByteSocket
InheritanceByteSocket Inheritance flash.events.EventDispatcher

ByteSocket provides binary socket abstraction for ActionScript.



Public Properties
 PropertyDefined by
  bufferedAmount : int
[read-only] The number of bytes queued to be sent.
ByteSocket
  onclose : Function
The onclose handler is called when the connection is terminated.
ByteSocket
  onmessage : Function
The omessage handler is called when data arrives.
ByteSocket
  onopen : Function
The onopen handler is called when the connection is established.
ByteSocket
  protocol : String
[read-only] The subprotocol selected by the server, if any.
ByteSocket
  readyState : Number
[read-only] The ready state indicates the connection status.
ByteSocket
  URL : String
[read-only] The URL with which the WebSocket was constructed.
ByteSocket
Public Methods
 MethodDefined by
  
ByteSocket(location:String, protocol:String = null)
ByteSocket
  
close(code:int = 0, reason:String = ""):void
Disconnects the remote socket location.
ByteSocket
  
handleClose(event:CloseEvent):void
ByteSocket
  
handleError(event:Event):void
ByteSocket
  
ByteSocket
  
handleOpen(event:Event):void
ByteSocket
  
send(data:ByteBuffer):Boolean
Sends binary data to the remote socket location.
ByteSocket
Events
 EventSummaryDefined by
   Dispatched when the connection is terminated.ByteSocket
   Dispatched when data arrives.ByteSocket
   Dispatched when the connection is established.ByteSocket
Property detail
bufferedAmountproperty
bufferedAmount:int  [read-only]

The number of bytes queued to be sent.

Implementation
    public function get bufferedAmount():int
oncloseproperty 
public var onclose:Function

The onclose handler is called when the connection is terminated.

onmessageproperty 
public var onmessage:Function

The omessage handler is called when data arrives.

onopenproperty 
public var onopen:Function

The onopen handler is called when the connection is established.

protocolproperty 
protocol:String  [read-only]

The subprotocol selected by the server, if any.

Implementation
    public function get protocol():String
readyStateproperty 
readyState:Number  [read-only]

The ready state indicates the connection status.

Implementation
    public function get readyState():Number
URLproperty 
URL:String  [read-only]

The URL with which the WebSocket was constructed.

Implementation
    public function get URL():String
Constructor detail
ByteSocket()constructor
public function ByteSocket(location:String, protocol:String = null)Parameters
location:String
 
protocol:String (default = null)
Method detail
close()method
public function close(code:int = 0, reason:String = ""):void

Disconnects the remote socket location.

Parameters
code:int (default = 0)
 
reason:String (default = "")
handleClose()method 
public function handleClose(event:CloseEvent):voidParameters
event:CloseEvent
handleError()method 
public function handleError(event:Event):voidParameters
event:Event
handleMessage()method 
public function handleMessage(event:MessageEvent):voidParameters
event:MessageEvent
handleOpen()method 
public function handleOpen(event:Event):voidParameters
event:Event
send()method 
public function send(data:ByteBuffer):Boolean

Sends binary data to the remote socket location.

Parameters
data:ByteBuffer — data the data payload

Returns
Boolean
Event detail
closeevent 
Event object type: CloseEvent

Dispatched when the connection is terminated.

messageevent  
Event object type: MessageEvent

Dispatched when data arrives.

openevent  
Event object type: flash.events.Event

Dispatched when the connection is established.