Defines session for WebSocket connection.
- Companion
- object
Value members
Abstract methods
Closes session with supplied status code.
Closes session with supplied status code.
- Value Params
- code
status code of closure
Gets WebSocket idle timeout in milliseconds.
Gets WebSocket idle timeout in milliseconds.
Timeout of zero disables this option – i.e., timeout is indefinite.
- Note
If no activity transpires for specified duration, then session is closed with status code GoingAway.
Sets WebSocket idle timeout.
Sets WebSocket idle timeout.
Timeout of zero disables this option – i.e., timeout is indefinite.
- Value Params
- milliseconds
idle timeout
- Returns
this session
- Note
If no activity transpires for specified duration, then session is closed with status code GoingAway.
Gets capacity of incoming message.
Gets capacity of incoming message.
- Note
If message exceeds specified capacity, then session is closed with status code MessageTooBig.
Sets capacity of incoming message.
Sets capacity of incoming message.
- Value Params
- size
message capacity in bytes
- Returns
this session
- Note
If message exceeds specified capacity, then session is closed with status code MessageTooBig.
Sets handler for incoming binary message.
Sets handler for incoming binary message.
- Value Params
- handler
binary message handler
- Returns
this session
Sets handler to be notified when session closes.
Sets handler to be notified when session closes.
- Value Params
- handler
close handler
- Returns
this session
Sets handler to be notified when session error occurs.
Sets handler to be notified when session error occurs.
- Value Params
- handler
error handler
- Returns
this session
Sets handler for incoming ping message.
Sets handler for incoming ping message.
- Value Params
- handler
ping message handler
- Returns
this session
Sets handler for incoming pong message.
Sets handler for incoming pong message.
- Value Params
- handler
pong message handler
- Returns
this session
Sets handler for incoming text message.
Sets handler for incoming text message.
- Value Params
- handler
text message handler
- Returns
this session
Gets payload limit of outgoing message.
Gets payload limit of outgoing message.
- Note
If outgoing message exceeds specified limit, then message is sent over multiple frames.
Gets payload limit of outgoing message.
Gets payload limit of outgoing message.
- Value Params
- length
payload limit in bytes
- Returns
this session
- Note
If outgoing message exceeds specified limit, then message is sent over multiple frames.
Sends ping message asynchronously and on completion passes result to supplied callback.
Sends ping message asynchronously and on completion passes result to supplied callback.
- Value Params
- callback
result handler
- data
application data to accompany ping message
Sends pong message asynchronously and on completion passes result to supplied callback.
Sends pong message asynchronously and on completion passes result to supplied callback.
- Value Params
- callback
result handler
- data
application data to accompany pong message
Sends message.
Sends message.
If binary
is true
, then binary message is sent; otherwise, text message
is sent.
- Value Params
- binary
indicator for binary message
- message
input stream to message
Sends text message asynchronously and on completion passes result to supplied callback.
Sends text message asynchronously and on completion passes result to supplied callback.
- Value Params
- callback
result handler
- message
text message
Sends binary message asynchronously and on completion passes result to supplied callback.
Sends binary message asynchronously and on completion passes result to supplied callback.
- Value Params
- callback
result handler
- message
binary message
Sends message asynchronously and on completion passes result to supplied callback.
Sends message asynchronously and on completion passes result to supplied callback.
If binary
is true
, then binary message is sent; otherwise, text message
is sent.
- Value Params
- binary
indicator for binary message
- callback
result handler
- message
input stream to message