public class WebSocketPolicy extends Object
Constructor and Description |
---|
WebSocketPolicy(WebSocketBehavior behavior) |
Modifier and Type | Method and Description |
---|---|
void |
assertValidBinaryMessageSize(int requestedSize) |
void |
assertValidTextMessageSize(int requestedSize) |
WebSocketPolicy |
clonePolicy() |
long |
getAsyncWriteTimeout()
The timeout in ms (milliseconds) for async write operations.
|
WebSocketBehavior |
getBehavior() |
long |
getIdleTimeout()
The time in ms (milliseconds) that a websocket connection mad by idle before being closed automatically.
|
int |
getInputBufferSize()
The size of the input (read from network layer) buffer size.
|
int |
getMaxBinaryMessageBufferSize()
Get the maximum size of a binary message buffer (for streaming writing)
|
int |
getMaxBinaryMessageSize()
Get the maximum size of a binary message during parsing/generating.
|
int |
getMaxTextMessageBufferSize()
Get the maximum size of a text message buffer (for streaming writing)
|
int |
getMaxTextMessageSize()
Get the maximum size of a text message during parsing/generating.
|
static WebSocketPolicy |
newClientPolicy() |
static WebSocketPolicy |
newServerPolicy() |
void |
setAsyncWriteTimeout(long ms)
The timeout in ms (milliseconds) for async write operations.
|
void |
setIdleTimeout(long ms)
The time in ms (milliseconds) that a websocket may be idle before closing.
|
void |
setInputBufferSize(int size)
The size of the input (read from network layer) buffer size.
|
void |
setMaxBinaryMessageBufferSize(int size)
The maximum size of a binary message buffer.
|
void |
setMaxBinaryMessageSize(int size)
The maximum size of a binary message during parsing/generating.
|
void |
setMaxTextMessageBufferSize(int size)
The maximum size of a text message buffer.
|
void |
setMaxTextMessageSize(int size)
The maximum size of a text message during parsing/generating.
|
String |
toString() |
public WebSocketPolicy(WebSocketBehavior behavior)
public static WebSocketPolicy newClientPolicy()
public static WebSocketPolicy newServerPolicy()
public void assertValidBinaryMessageSize(int requestedSize)
public void assertValidTextMessageSize(int requestedSize)
public WebSocketPolicy clonePolicy()
public long getAsyncWriteTimeout()
Negative values indicate a disabled timeout.
public WebSocketBehavior getBehavior()
public long getIdleTimeout()
public int getInputBufferSize()
This is the raw read operation buffer size, before the parsing of the websocket frames.
public int getMaxBinaryMessageBufferSize()
public int getMaxBinaryMessageSize()
Binary messages over this maximum will result in a close code 1009 StatusCode.MESSAGE_TOO_LARGE
public int getMaxTextMessageBufferSize()
public int getMaxTextMessageSize()
Text messages over this maximum will result in a close code 1009 StatusCode.MESSAGE_TOO_LARGE
public void setAsyncWriteTimeout(long ms)
Negative values indicate a disabled timeout.
ms
- the timeout in millisecondspublic void setIdleTimeout(long ms)
ms
- the timeout in millisecondspublic void setInputBufferSize(int size)
size
- the size in bytespublic void setMaxBinaryMessageBufferSize(int size)
Used ONLY for stream based message writing.
size
- the maximum size of the binary message bufferpublic void setMaxBinaryMessageSize(int size)
Binary messages over this maximum will result in a close code 1009 StatusCode.MESSAGE_TOO_LARGE
size
- the maximum allowed size of a binary message.public void setMaxTextMessageBufferSize(int size)
Used ONLY for stream based message writing.
size
- the maximum size of the text message bufferpublic void setMaxTextMessageSize(int size)
Text messages over this maximum will result in a close code 1009 StatusCode.MESSAGE_TOO_LARGE
size
- the maximum allowed size of a text message.Copyright © 1995-2015 Webtide. All Rights Reserved.