| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private volatile String | |
| protected final HttpHeaders | |
| protected static final int | |
| private final String | |
| private static final AtomicIntegerFieldUpdater | |
| private volatile boolean | |
| private volatile int | |
| private volatile long | |
| private volatile boolean | |
| private final int | |
| private final URI | |
| private final WebSocketVersion |
| Access | Constructor and Description |
|---|---|
| protected | WebSocketClientHandshaker(URI
URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
sent to this URL. uri, WebSocketVersion Version of web socket specification to use to connect to the server version, String Sub protocol request sent to the server. subprotocol, HttpHeaders Map of custom headers to add to the client request customHeaders, int Maximum length of a frame's payload maxFramePayloadLength)Base constructor |
| protected | WebSocketClientHandshaker(URI
URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
sent to this URL. uri, WebSocketVersion Version of web socket specification to use to connect to the server version, String Sub protocol request sent to the server. subprotocol, HttpHeaders Map of custom headers to add to the client request customHeaders, int Maximum length of a frame's payload maxFramePayloadLength, long Close the connection if it was not closed by the server after timeout specified forceCloseTimeoutMillis)Base constructor |
| protected | WebSocketClientHandshaker(URI
URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
sent to this URL. uri, WebSocketVersion Version of web socket specification to use to connect to the server version, String Sub protocol request sent to the server. subprotocol, HttpHeaders Map of custom headers to add to the client request customHeaders, int Maximum length of a frame's payload maxFramePayloadLength, long Close the connection if it was not closed by the server after timeout specified forceCloseTimeoutMillis, boolean Use an absolute url for the Upgrade request, typically when connecting through an HTTP proxy over
clear HTTP absoluteUpgradeUrl)Base constructor |
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| public Future | close(Channel
Channel channel, CloseWebSocketFrame Closing Frame that was received frame)Performs the closing handshake. |
| public Future | close(ChannelHandlerContext
the ctx, CloseWebSocketFrame ChannelHandlerContext to use.Closing Frame that was received frame)Performs the closing handshake |
| private Future | |
| public String | expectedSubprotocol()
Returns the CSV of requested subprotocol(s) sent to the server as specified in the constructor |
| public final void | finishHandshake(Channel
Channel channel, FullHttpResponse HTTP response containing the closing handshake details response)Validates and finishes the opening handshake initiated by |
| public long | |
| public Future | |
| protected boolean | |
| public boolean | |
| public int | |
| protected abstract FullHttpRequest | newHandshakeRequest(BufferAllocator allocator)
Returns a new {@link FullHttpRequest) which will be used for the handshake. |
| protected abstract WebSocketFrameDecoder | |
| protected abstract WebSocketFrameEncoder | |
| public final Future | Returns: future theFuture which is notified once the handshake completes.Channel channel, HttpResponse HTTP response containing the closing handshake details response)Process the opening handshake initiated by |
| private void | |
| public WebSocketClientHandshaker | setForceCloseTimeoutMillis(long
Close the connection if it was not closed by the server after timeout specified forceCloseTimeoutMillis)Sets timeout to close the connection if it was not closed by the server. |
| private void | |
| protected String | |
| public URI | |
| protected abstract void | verify(FullHttpResponse response)
Verify the |
| public WebSocketVersion | |
| pack-priv static CharSequence |
| absoluteUpgradeUrl | back to summary |
|---|---|
| private final boolean absoluteUpgradeUrl | |
| actualSubprotocol | back to summary |
|---|---|
| private volatile String actualSubprotocol | |
| customHeaders | back to summary |
|---|---|
| protected final HttpHeaders customHeaders | |
| DEFAULT_FORCE_CLOSE_TIMEOUT_MILLIS | back to summary |
|---|---|
| protected static final int DEFAULT_FORCE_CLOSE_TIMEOUT_MILLIS | |
| expectedSubprotocol | back to summary |
|---|---|
| private final String expectedSubprotocol | |
| FORCE_CLOSE_INIT_UPDATER | back to summary |
|---|---|
| private static final AtomicIntegerFieldUpdater<WebSocketClientHandshaker> FORCE_CLOSE_INIT_UPDATER | |
| forceCloseComplete | back to summary |
|---|---|
| private volatile boolean forceCloseComplete | |
| forceCloseInit | back to summary |
|---|---|
| private volatile int forceCloseInit | |
| forceCloseTimeoutMillis | back to summary |
|---|---|
| private volatile long forceCloseTimeoutMillis | |
| handshakeComplete | back to summary |
|---|---|
| private volatile boolean handshakeComplete | |
| maxFramePayloadLength | back to summary |
|---|---|
| private final int maxFramePayloadLength | |
| uri | back to summary |
|---|---|
| private final URI uri | |
| version | back to summary |
|---|---|
| private final WebSocketVersion version | |
| WebSocketClientHandshaker | back to summary |
|---|---|
| protected WebSocketClientHandshaker(URI uri, WebSocketVersion version, String subprotocol, HttpHeaders customHeaders, int maxFramePayloadLength) Base constructor
| |
| WebSocketClientHandshaker | back to summary |
|---|---|
| protected WebSocketClientHandshaker(URI uri, WebSocketVersion version, String subprotocol, HttpHeaders customHeaders, int maxFramePayloadLength, long forceCloseTimeoutMillis) Base constructor
| |
| WebSocketClientHandshaker | back to summary |
|---|---|
| protected WebSocketClientHandshaker(URI uri, WebSocketVersion version, String subprotocol, HttpHeaders customHeaders, int maxFramePayloadLength, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl) Base constructor
| |
| actualSubprotocol | back to summary |
|---|---|
| public String actualSubprotocol() Returns the subprotocol response sent by the server. Only available after end of handshake. Null if no subprotocol was requested or confirmed by the server. | |
| close | back to summary |
|---|---|
| public Future Performs the closing handshake.
When called from within a
| |
| close | back to summary |
|---|---|
| public Future Performs the closing handshake
| |
| close0 | back to summary |
|---|---|
| private Future | |
| expectedSubprotocol | back to summary |
|---|---|
| public String expectedSubprotocol() Returns the CSV of requested subprotocol(s) sent to the server as specified in the constructor | |
| finishHandshake | back to summary |
|---|---|
| public final void finishHandshake(Channel channel, FullHttpResponse response) Validates and finishes the opening handshake initiated by
| |
| forceCloseTimeoutMillis | back to summary |
|---|---|
| public long forceCloseTimeoutMillis() | |
| handshake | back to summary |
|---|---|
| public Future Begins the opening handshake
| |
| isForceCloseComplete | back to summary |
|---|---|
| protected boolean isForceCloseComplete() Flag to indicate if the closing handshake was initiated because of timeout. For testing only. | |
| isHandshakeComplete | back to summary |
|---|---|
| public boolean isHandshakeComplete() Flag to indicate if the opening handshake is complete | |
| maxFramePayloadLength | back to summary |
|---|---|
| public int maxFramePayloadLength() Returns the max length for any frame's payload | |
| newHandshakeRequest | back to summary |
|---|---|
| protected abstract FullHttpRequest newHandshakeRequest(BufferAllocator allocator) Returns a new {@link FullHttpRequest) which will be used for the handshake. | |
| newWebsocketDecoder | back to summary |
|---|---|
| protected abstract WebSocketFrameDecoder newWebsocketDecoder() Returns the decoder to use after handshake is complete. | |
| newWebSocketEncoder | back to summary |
|---|---|
| protected abstract WebSocketFrameEncoder newWebSocketEncoder() Returns the encoder to use after the handshake is complete. | |
| processHandshake | back to summary |
|---|---|
| public final Future Process the opening handshake initiated by
| |
| setActualSubprotocol | back to summary |
|---|---|
| private void setActualSubprotocol(String actualSubprotocol) | |
| setForceCloseTimeoutMillis | back to summary |
|---|---|
| public WebSocketClientHandshaker setForceCloseTimeoutMillis(long forceCloseTimeoutMillis) Sets timeout to close the connection if it was not closed by the server.
| |
| setHandshakeComplete | back to summary |
|---|---|
| private void setHandshakeComplete() | |
| upgradeUrl | back to summary |
|---|---|
| protected String upgradeUrl(URI wsURL) Return the constructed raw path for the give | |
| uri | back to summary |
|---|---|
| public URI uri() Returns the URI to the web socket. e.g. "ws://myhost.com/path" | |
| verify | back to summary |
|---|---|
| protected abstract void verify(FullHttpResponse response) Verify the | |
| version | back to summary |
|---|---|
| public WebSocketVersion version() Version of the web socket specification that is being used | |
| websocketHostValue | back to summary |
|---|---|
| pack-priv static CharSequence websocketHostValue(URI wsURL) | |