See: Description
This package provides the public API for establishing and using WebSocket connections according to RFC 6455. WebSocket sessions are created by upgrading an HTTP request and are backed internally by the non-blocking I/O reactor used by the HttpClient async APIs.
Experimental. This module is experimental. Its public API is not yet stable and may change in an incompatible way, or be removed, in a future release; it is excluded from the project's binary and source backward-compatibility guarantees for the 5.7 release series.
WebSocket –
application view of a single WebSocket connection, used to send
text and binary messages and initiate the close handshake.WebSocketListener –
callback interface that receives inbound messages, pings, pongs,
errors, and close notifications.WebSocketClientConfig –
immutable configuration for timeouts, maximum frame and message
sizes, auto-pong behaviour, and buffer management.CloseableWebSocketClient –
high-level client for establishing WebSocket connections.WebSocketClients and
WebSocketClientBuilder –
factory and builder for creating and configuring WebSocket clients.Outbound operations on WebSocket are thread-safe and may be
invoked from arbitrary application threads. Inbound callbacks on
WebSocketListener are normally executed on I/O dispatcher
threads; listeners should avoid long blocking operations.
The implementation follows the close handshake defined in RFC 6455.
Applications should initiate shutdown via
WebSocket.close(int, String)
and treat receipt of a close frame as a terminal event. The configured
closeWaitTimeout controls how long the client will wait for the
peer's close frame before the underlying connection is closed.
Classes in org.apache.hc.core5.websocket subpackages and
org.apache.hc.client5.http.websocket.transport are internal
implementation details and are not intended for direct use.
Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.