RingoJS

Module ringo/httpserver/websocket

Class WebSocket

Instance Methods


WebSocket

Not exported as constructor by this module.


WebSocket.prototype. close ()

Closes the WebSocket connection.


WebSocket.prototype. isOpen ()

Check whether the WebSocket is open.

Returns

Boolean

true if the connection is open


WebSocket.prototype. send (message)

Deprecated!

Send a string over the WebSocket.

Parameters

String message

a string


WebSocket.prototype. sendBinary (byteArray, offset, length)

Send a byte array over the WebSocket. This method blocks until the message as been transmitted.

Parameters

ByteArray byteArray

The byte array to send

Number offset

Optional offset (defaults to zero)

Number length

Optional length (defaults to the length of the byte array)


WebSocket.prototype. sendBinaryAsync (byteArray, offset, length)

Send a byte array over the WebSocket. This method does not wait until the message as been transmitted.

Parameters

ByteArray byteArray

The byte array to send

Number offset

Optional offset (defaults to zero)

Number length

Optional length (defaults to the length of the byte array)

Returns

java.util.concurrent.Future

WebSocket.prototype. sendString (message)

Send a string over the WebSocket. This method blocks until the message has been transmitted

Parameters

String message

a string


WebSocket.prototype. sendStringAsync (message)

Send a string over the WebSocket. This method does not wait until the message as been transmitted.

Parameters

String message

a string