public static final class WebSocketClientConfig.Builder extends Object
WebSocketClientConfig.
The builder is mutable and not thread-safe.
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
WebSocketClientConfig |
build()
Builds an immutable
WebSocketClientConfig. |
WebSocketClientConfig.Builder |
enableHttp2(boolean enabled)
Enables HTTP/2 Extended CONNECT (RFC 8441) for supported endpoints.
|
WebSocketClientConfig.Builder |
enablePerMessageDeflate(boolean v)
Enables or disables offering
permessage-deflate during the handshake. |
WebSocketClientConfig.Builder |
offerClientNoContextTakeover(boolean v)
Offers
client_no_context_takeover in the PMCE offer. |
WebSocketClientConfig.Builder |
offerServerMaxWindowBits(Integer v)
Offers
server_max_window_bits in the PMCE offer. |
WebSocketClientConfig.Builder |
offerServerNoContextTakeover(boolean v)
Offers
server_no_context_takeover in the PMCE offer. |
WebSocketClientConfig.Builder |
setAutoPong(boolean v)
Enables or disables automatic PONG replies for received PING frames.
|
WebSocketClientConfig.Builder |
setCloseWaitTimeout(Timeout v)
Sets the close handshake wait timeout.
|
WebSocketClientConfig.Builder |
setConnectTimeout(Timeout v)
Sets the timeout used to establish the initial TCP/TLS connection.
|
WebSocketClientConfig.Builder |
setDirectBuffers(boolean v)
Enables or disables the use of direct buffers for internal I/O.
|
WebSocketClientConfig.Builder |
setMaxFrameSize(int v)
Sets the maximum accepted frame payload size.
|
WebSocketClientConfig.Builder |
setMaxFramesPerTick(int v)
Sets the limit of frames written per reactor tick.
|
WebSocketClientConfig.Builder |
setMaxMessageSize(long v)
Sets the maximum accepted message size.
|
WebSocketClientConfig.Builder |
setMaxOutboundControlQueue(int v)
Sets the maximum number of queued outbound control frames.
|
WebSocketClientConfig.Builder |
setMaxOutboundDataBytes(long v)
Sets the maximum number of bytes that can be queued for outbound data frames.
|
WebSocketClientConfig.Builder |
setOutgoingChunkSize(int v)
Sets the preferred outgoing fragmentation chunk size.
|
WebSocketClientConfig.Builder |
setSubprotocols(List<String> v)
Sets the ordered list of subprotocols offered to the server.
|
public WebSocketClientConfig.Builder setConnectTimeout(Timeout v)
v - timeout, may be null to rely on defaultspublic WebSocketClientConfig.Builder setSubprotocols(List<String> v)
v - list of subprotocol names, may be null to offer nonepublic WebSocketClientConfig.Builder enablePerMessageDeflate(boolean v)
permessage-deflate during the handshake.v - true to offer PMCE, false otherwisepublic WebSocketClientConfig.Builder offerServerNoContextTakeover(boolean v)
server_no_context_takeover in the PMCE offer.v - whether to include the parameter in the offerpublic WebSocketClientConfig.Builder offerClientNoContextTakeover(boolean v)
client_no_context_takeover in the PMCE offer.v - whether to include the parameter in the offerpublic WebSocketClientConfig.Builder offerServerMaxWindowBits(Integer v)
server_max_window_bits in the PMCE offer.
Valid values are in range 8..15 when non-null. This value limits the server's compressor; the client decoder can accept any 8..15 value.
v - window bits, or null to omit the parameterpublic WebSocketClientConfig.Builder setMaxFrameSize(int v)
v - maximum frame payload size in bytes (must be > 0)public WebSocketClientConfig.Builder setOutgoingChunkSize(int v)
v - chunk size in bytes (must be > 0)public WebSocketClientConfig.Builder setMaxFramesPerTick(int v)
v - max frames per tick (must be > 0)public WebSocketClientConfig.Builder setDirectBuffers(boolean v)
v - true for direct buffers, false for heap bufferspublic WebSocketClientConfig.Builder setAutoPong(boolean v)
v - true to auto-reply with PONGpublic WebSocketClientConfig.Builder setCloseWaitTimeout(Timeout v)
v - close wait timeout, must not be nullpublic WebSocketClientConfig.Builder setMaxMessageSize(long v)
v - max message size in bytes (must be > 0)public WebSocketClientConfig.Builder setMaxOutboundControlQueue(int v)
v - max control queue size (must be > 0)public WebSocketClientConfig.Builder setMaxOutboundDataBytes(long v)
When the limit is exceeded, sendText/sendBinary return false.
A value of 0 disables the limit.
v - max queued bytes for outbound data framespublic WebSocketClientConfig.Builder enableHttp2(boolean enabled)
enabled - true to enable HTTP/2 WebSocket connectionspublic WebSocketClientConfig build()
WebSocketClientConfig.IllegalArgumentException - if any parameter is invalidCopyright © 1999–2021 The Apache Software Foundation. All rights reserved.