Class Index | File Index

Classes


Class R.Socket

A web socket for two-way network communication. You should not create an object from this class directly. Instead, see R.util.SocketUtil#createSocket
Defined in: socket.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
<static>  
R.Socket.MSG_ACK
Socket acknowledges message received and handled type
<static>  
R.Socket.MSG_CONNECT
Socket connected message type
<static>  
R.Socket.MSG_DISCONNECT
Socket disconnected message type
<static>  
R.Socket.MSG_SERVER
Server broadcast message type
Method Summary
Method Attributes Method Name and Description
 
assure(msg, cb)
Sends a message with a guarantee that will be returned by the server when the message is received.
 
broadcast(msg)
Send a broadcast message to the server.
 
Attempt to connect the socket to its destination.
 
done()
Call this method to complete all communications with the socket and return it to the pool.
 
send(msg)
Send a message without a guarantee that the message was received or handled by the server.
Class Detail
R.Socket()
Field Detail
<static> R.Socket.MSG_ACK
Socket acknowledges message received and handled type

<static> R.Socket.MSG_CONNECT
Socket connected message type

<static> R.Socket.MSG_DISCONNECT
Socket disconnected message type

<static> R.Socket.MSG_SERVER
Server broadcast message type
Method Detail
{Number} assure(msg, cb)
Sends a message with a guarantee that will be returned by the server when the message is received.
Parameters:
msg
{Object} The message to send
cb Optional
{Function} The callback function, or null.
Returns:
{Number} The packet number

broadcast(msg)
Send a broadcast message to the server. Broadcast messages are sent to all connected clients and are not guaranteed.
Parameters:
msg
{Object} The message to send

connect()
Attempt to connect the socket to its destination. Upon successful connection, the listener() method attached to the socket will be triggered.

done()
Call this method to complete all communications with the socket and return it to the pool.

send(msg)
Send a message without a guarantee that the message was received or handled by the server.
Parameters:
msg
{Object} The message to send

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 16:09:20 GMT-0400 (EDT)