public class WebSocketOptions
extends java.lang.Object
| Constructor and Description |
|---|
WebSocketOptions()
Construct default options.
|
WebSocketOptions(WebSocketOptions other)
Construct options as copy from other options object.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
getMaskClientFrames()
Get mask client frames option.
|
int |
getMaxFramePayloadSize()
Get maxium frame payload size that will be accepted
when receiving.
|
int |
getMaxMessagePayloadSize()
Get maximum message payload size (after reassembly of fragmented
messages) that will be accepted when receiving.
|
boolean |
getReceiveTextMessagesRaw()
When true, WebSockets text messages are provided as
verified, but non-decoded UTF-8 in byte arrays.
|
int |
getReconnectInterval() |
int |
getSocketConnectTimeout()
Get socket connect timeout.
|
int |
getSocketReceiveTimeout()
Get socket receive timeout.
|
boolean |
getTcpNoDelay()
Get TCP No-Delay ("Nagle") for TCP connection.
|
boolean |
getValidateIncomingUtf8()
Get UTF-8 validation option.
|
void |
setMaskClientFrames(boolean enabled)
Controls whether to mask client-to-server WebSocket frames.
|
void |
setMaxFramePayloadSize(int size)
Set maximum frame payload size that will be accepted
when receiving.
|
void |
setMaxMessagePayloadSize(int size)
Set maximum message payload size (after reassembly of fragmented
messages) that will be accepted when receiving.
|
void |
setReceiveTextMessagesRaw(boolean enabled)
Receive text message as raw byte array with verified,
but non-decoded UTF-8.
|
void |
setReconnectInterval(int reconnectInterval)
Set reconnect interval
|
void |
setSocketConnectTimeout(int timeoutMs)
Set connect timeout on socket.
|
void |
setSocketReceiveTimeout(int timeoutMs)
Set receive timeout on socket.
|
void |
setTcpNoDelay(boolean enabled)
Set TCP No-Delay ("Nagle") for TCP connection.
|
void |
setValidateIncomingUtf8(boolean enabled)
Controls whether incoming text message payload is verified
to be valid UTF-8.
|
public WebSocketOptions()
public WebSocketOptions(WebSocketOptions other)
other - Options to copy.public void setReceiveTextMessagesRaw(boolean enabled)
DEFAULT: false
enabled - True to enable.public boolean getReceiveTextMessagesRaw()
public void setMaxFramePayloadSize(int size)
DEFAULT: 4MB
size - Maximum size in octets for frame payload.public int getMaxFramePayloadSize()
public void setMaxMessagePayloadSize(int size)
DEFAULT: 4MB
size - Maximum size in octets for message payload.public int getMaxMessagePayloadSize()
public void setTcpNoDelay(boolean enabled)
DEFAULT: true
enabled - True to enable TCP No-Delay.public boolean getTcpNoDelay()
public void setSocketReceiveTimeout(int timeoutMs)
DEFAULT: 200
timeoutMs - Socket receive timeout in ms.public int getSocketReceiveTimeout()
public void setSocketConnectTimeout(int timeoutMs)
DEFAULT: 3000
timeoutMs - Socket connect timeout in ms.public int getSocketConnectTimeout()
public void setValidateIncomingUtf8(boolean enabled)
DEFAULT: true
enabled - True to verify incoming UTF-8.public boolean getValidateIncomingUtf8()
public void setMaskClientFrames(boolean enabled)
DEFAULT: true
enabled - Set true to mask client-to-server frames.public boolean getMaskClientFrames()
public void setReconnectInterval(int reconnectInterval)
reconnectInterval - Interval in ms, 0 - no reconnectionpublic int getReconnectInterval()