It implements both ReadStream and WriteStream so it can be used with
io. to pipe data with flow control.
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: the binary handler idWhen a |
| public WebSocketBase | Returns: a reference to this, so the API can be used fluentlythe handler handler)Set a binary message handler on the connection. |
| public Future | Returns: a future completed with the resultClose the WebSocket sending the default close frame. |
| public void | close(Handler<AsyncResult<Void>> handler)
Same as |
| public Future | Returns: a future completed with the resultthe status code statusCode)Close the WebSocket sending a close frame with specified status code. |
| public void | close(short statusCode, Handler<AsyncResult<Void>> handler)
Same as |
| public Future | |
| public void | close(short statusCode, @Nullable String reason, Handler<AsyncResult<Void>> handler)
Same as |
| public WebSocketBase | Returns: a reference to this, so the API can be used fluentlythe handler handler)Set a close handler. |
| public String | closeReason()
Returns the close reason message from the remote endpoint or |
| public Short | closeStatusCode()
Returns the close status code received from the remote endpoint or |
| public WebSocketBase | |
| public Future | |
| public void | end(Handler<AsyncResult<Void>> handler)
Redeclares io. Redeclares as abstract: io. Same as |
| public WebSocketBase | |
| public WebSocketBase | |
| public WebSocketBase | fetch(long amount)
Redeclares io. Fetch the specified |
| public WebSocketBase | Returns: a reference to this, so the API can be used fluentlythe handler handler)Set a frame handler on the connection. |
| public WebSocketBase | |
| public MultiMap | Returns: the headersReturns the HTTP headers when the WebSocket is first obtained in the handler. |
| public boolean | |
| public boolean | |
| public SocketAddress | Returns: the local address for this connection, possiblynull (e.g a server bound on a domain socket)
If useProxyProtocol is set to true, the address returned will be of the proxy.
|
| public WebSocketBase | pause()
Redeclares io. Pause the |
| public X509Certificate[] | Returns: an ordered array of the peer certificates. Returns null if connection is not SSL.
Deprecated
instead use
peerCertificates() or sslSession()
|
| public List | Returns: an ordered list of the peer certificates. Returns null if connection is not SSL.
|
| public WebSocketBase | Returns: a reference to this, so the API can be used fluentlythe handler handler)Set a pong frame handler on the connection. |
| public SocketAddress | Returns: the remote address for this connection, possiblynull (e.g a server bound on a domain socket).
If useProxyProtocol is set to true, the address returned will be of the actual connecting client.
|
| public WebSocketBase | resume()
Redeclares io. Resume reading, and sets the buffer in |
| public WebSocketBase | setWriteQueueMaxSize(int
the max size of the write stream maxSize)Redeclares io. Set the maximum size of the write queue to |
| public SSLSession | Returns: SSLSession associated with the underlying socket. Returns null if connection is not SSL.
|
| public String | |
| public String | Returns: the text handler idWhen a |
| public WebSocketBase | Returns: a reference to this, so the API can be used fluentlythe handler handler)Set a text message handler on the connection. |
| public Future | Returns: a future completed with the resultthe data to write data)
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Writes a (potentially large) piece of binary data to the connection. |
| public WebSocketBase | writeBinaryMessage(Buffer data, Handler<AsyncResult<Void>> handler)
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Same as |
| public Future | Returns: a future completed with the resultThe data to write data)
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Write a final WebSocket binary frame to the connection |
| public WebSocketBase | writeFinalBinaryFrame(Buffer data, Handler<AsyncResult<Void>> handler)
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Same as |
| public Future | Returns: a future completed with the resultThe text to write text)Write a final WebSocket text frame to the connection |
| public WebSocketBase | writeFinalTextFrame(String text, Handler<AsyncResult<Void>> handler)
Same as |
| public Future | Returns: a future completed with the resultthe frame to write frame)Write a WebSocket frame to the connection |
| public WebSocketBase | writeFrame(WebSocketFrame frame, Handler<AsyncResult<Void>> handler)
Same as |
| public WebSocketBase | Returns: a reference to this, so the API can be used fluentlythe data to write, may be at most 125 bytes data, Handler<AsyncResult<Void>> called when the ping frame has been successfully written handler)
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Writes a ping frame to the connection. |
| public Future | writePing(Buffer data)
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Like |
| public WebSocketBase | Returns: a reference to this, so the API can be used fluentlythe data to write, may be at most 125 bytes data, Handler<AsyncResult<Void>> called when the pong frame has been successfully written handler)
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Writes a pong frame to the connection. |
| public Future | writePong(Buffer data)
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Like |
| public Future | Returns: a future completed with the resultthe data to write text)Writes a (potentially large) piece of text data to the connection. |
| public WebSocketBase | writeTextMessage(String text, Handler<AsyncResult<Void>> handler)
Same as |
| binaryHandlerID | back to summary |
|---|---|
| public String binaryHandlerID() When a
By default, no handler is registered, the feature must be enabled via Given this ID, a different event loop can send a binary frame to that event handler using the event bus and that buffer will be received by this instance in its own event loop and written to the underlying connection. This allows you to write data to other WebSockets which are owned by different event loops.
| |
| binaryMessageHandler | back to summary |
|---|---|
| public WebSocketBase binaryMessageHandler(@Nullable Handler<Buffer> handler) Set a binary message handler on the connection. This handler serves a similar purpose to
| |
| close | back to summary |
|---|---|
| public Future Close the WebSocket sending the default close frame. No more messages can be sent. | |
| close | back to summary |
|---|---|
| public void close(Handler<AsyncResult<Void>> handler) Same as | |
| close | back to summary |
|---|---|
| public Future Close the WebSocket sending a close frame with specified status code. You can give a look at various close payloads here: RFC6455 section 7.4.1 No more messages can be sent. | |
| close | back to summary |
|---|---|
| public void close(short statusCode, Handler<AsyncResult<Void>> handler) Same as | |
| close | back to summary |
|---|---|
| public Future Close sending a close frame with specified status code and reason. You can give a look at various close payloads here: RFC6455 section 7.4.1 No more messages can be sent. | |
| close | back to summary |
|---|---|
| public void close(short statusCode, @Nullable String reason, Handler<AsyncResult<Void>> handler) Same as | |
| closeHandler | back to summary |
|---|---|
| public WebSocketBase closeHandler(@Nullable Handler<Void> handler) Set a close handler. This will be called when the WebSocket is closed.
After this callback, no more messages are expected. When the WebSocket received a close frame, the
| |
| closeReason | back to summary |
|---|---|
| public String closeReason() Returns the close reason message from the remote endpoint or | |
| closeStatusCode | back to summary |
|---|---|
| public Short closeStatusCode() Returns the close status code received from the remote endpoint or | |
| drainHandler | back to summary |
|---|---|
public WebSocketBase drainHandler(Handler<Void> handler)
| |
| end | back to summary |
|---|---|
| public Future Redeclares as abstract: io. Doc from io. Ends the stream.
Once the stream has ended, it cannot be used any more.
Calls | |
| end | back to summary |
|---|---|
| public void end(Handler<AsyncResult<Void>> handler) Redeclares io. Redeclares as abstract: io. Doc from io. Same as
| |
| endHandler | back to summary |
|---|---|
public WebSocketBase endHandler(Handler<Void> endHandler)
| |
| exceptionHandler | back to summary |
|---|---|
public WebSocketBase exceptionHandler(Handler<Throwable> handler)
| |
| fetch | back to summary |
|---|---|
| public WebSocketBase fetch(long amount) Redeclares io. Doc from io. Fetch the specified
| |
| frameHandler | back to summary |
|---|---|
| public WebSocketBase frameHandler(@Nullable Handler<WebSocketFrame> handler) Set a frame handler on the connection. This handler will be called when frames are read on the connection.
| |
| handler | back to summary |
|---|---|
public WebSocketBase handler(Handler<Buffer> handler)
| |
| headers | back to summary |
|---|---|
| public MultiMap headers() Returns the HTTP headers when the WebSocket is first obtained in the handler.
The headers will be
| |
| isClosed | back to summary |
|---|---|
public boolean isClosed()
| |
| isSsl | back to summary |
|---|---|
public boolean isSsl()
| |
| localAddress | back to summary |
|---|---|
public SocketAddress localAddress()
| |
| pause | back to summary |
|---|---|
| public WebSocketBase pause() Redeclares io. Doc from io. Pause the
While it's paused, no data will be sent to the data
| |
| peerCertificateChain | back to summary |
|---|---|
| public X509Certificate[] peerCertificateChain() throws SSLPeerUnverifiedException
Deprecated instead use
| |
| peerCertificates | back to summary |
|---|---|
public List
| |
| pongHandler | back to summary |
|---|---|
| public WebSocketBase pongHandler(@Nullable Handler<Buffer> handler) Set a pong frame handler on the connection. This handler will be invoked every time a pong frame is received on the server, and can be used by both clients and servers since the RFC 6455 section 5.5.2 and section 5.5.3 do not specify whether the client or server sends a ping. Pong frames may be at most 125 bytes (octets). There is no ping handler since ping frames should immediately be responded to with a pong frame with identical content Pong frames may be received unsolicited.
| |
| remoteAddress | back to summary |
|---|---|
public SocketAddress remoteAddress()
| |
| resume | back to summary |
|---|---|
| public WebSocketBase resume() Redeclares io. Doc from io. Resume reading, and sets the buffer in
If the
| |
| setWriteQueueMaxSize | back to summary |
|---|---|
| public WebSocketBase setWriteQueueMaxSize(int maxSize) Redeclares io. Doc from io. Set the maximum size of the write queue to
The value is defined by the implementation of the stream, e.g in bytes for a
| |
| sslSession | back to summary |
|---|---|
public SSLSession sslSession()
| |
| subProtocol | back to summary |
|---|---|
| public String subProtocol() Returns the WebSocket sub protocol selected by the WebSocket handshake.
On the server, the value will be | |
| textHandlerID | back to summary |
|---|---|
| public String textHandlerID() When a
By default, no handler is registered, the feature must be enabled via Given this ID, a different event loop can send a text frame to that event handler using the event bus and that buffer will be received by this instance in its own event loop and written to the underlying connection. This allows you to write data to other WebSockets which are owned by different event loops.
| |
| textMessageHandler | back to summary |
|---|---|
| public WebSocketBase textMessageHandler(@Nullable Handler<String> handler) Set a text message handler on the connection. This handler will be called similar to the
| |
| writeBinaryMessage | back to summary |
|---|---|
| public Future References Deprecated
See corresponding docs for further information. Writes a (potentially large) piece of binary data to the connection. This data might be written as multiple frames if it exceeds the maximum WebSocket frame size. | |
| writeBinaryMessage | back to summary |
|---|---|
| public WebSocketBase writeBinaryMessage(Buffer data, Handler<AsyncResult<Void>> handler)
References Deprecated
See corresponding docs for further information. Same as
| |
| writeFinalBinaryFrame | back to summary |
|---|---|
| public Future References Deprecated
See corresponding docs for further information. Write a final WebSocket binary frame to the connection | |
| writeFinalBinaryFrame | back to summary |
|---|---|
| public WebSocketBase writeFinalBinaryFrame(Buffer data, Handler<AsyncResult<Void>> handler)
References Deprecated
See corresponding docs for further information. Same as
| |
| writeFinalTextFrame | back to summary |
|---|---|
| public Future Write a final WebSocket text frame to the connection | |
| writeFinalTextFrame | back to summary |
|---|---|
| public WebSocketBase writeFinalTextFrame(String text, Handler<AsyncResult<Void>> handler) Same as
| |
| writeFrame | back to summary |
|---|---|
| public Future Write a WebSocket frame to the connection
| |
| writeFrame | back to summary |
|---|---|
| public WebSocketBase writeFrame(WebSocketFrame frame, Handler<AsyncResult<Void>> handler) Same as
| |
| writePing | back to summary |
|---|---|
| public WebSocketBase writePing(Buffer data, Handler<AsyncResult<Void>> handler)
References Deprecated
See corresponding docs for further information. Writes a ping frame to the connection. This will be written in a single frame. Ping frames may be at most 125 bytes (octets). This method should not be used to write application data and should only be used for implementing a keep alive or to ensure the client is still responsive, see RFC 6455 Section section 5.5.2. There is no handler for ping frames because RFC 6455 clearly states that the only response to a ping frame is a pong frame with identical contents.
| |
| writePing | back to summary |
|---|---|
| public Future References Deprecated
See corresponding docs for further information. Like | |
| writePong | back to summary |
|---|---|
| public WebSocketBase writePong(Buffer data, Handler<AsyncResult<Void>> handler)
References Deprecated
See corresponding docs for further information. Writes a pong frame to the connection. This will be written in a single frame. Pong frames may be at most 125 bytes (octets). This method should not be used to write application data and should only be used for implementing a keep alive or to ensure the client is still responsive, see RFC 6455 section 5.5.2. There is no need to manually write a pong frame, as the server and client both handle responding to a ping from with a pong from automatically and this is exposed to users. RFC 6455 section 5.5.3 states that pongs may be sent unsolicited in order to implement a one way heartbeat.
| |
| writePong | back to summary |
|---|---|
| public Future References Deprecated
See corresponding docs for further information. Like | |
| writeTextMessage | back to summary |
|---|---|
| public Future Writes a (potentially large) piece of text data to the connection. This data might be written as multiple frames if it exceeds the maximum WebSocket frame size. | |
| writeTextMessage | back to summary |
|---|---|
| public WebSocketBase writeTextMessage(String text, Handler<AsyncResult<Void>> handler) Same as
| |