Instances of this class are passed into a io. or provided
when a WebSocket handshake is manually HttpServerRequest#toWebSocketed.
| Modifier and Type | Method and Description |
|---|---|
| public void | accept()
Deprecated
instead use
ServerWebSocketHandshake#accept()
Accept the WebSocket and terminate the WebSocket handshake. |
| public @Nullable HostAndPort | |
| public Future | close()
Redeclares io. Close the WebSocket sending the default close frame. |
| public ServerWebSocket | |
| public ServerWebSocket | |
| public ServerWebSocket | |
| public ServerWebSocket | exceptionHandler(Handler<Throwable> handler)
Redeclares io.
|
| public ServerWebSocket | fetch(long amount)
Redeclares io. Fetch the specified |
| public ServerWebSocket | |
| public ServerWebSocket | |
| public @Nullable String | |
| public String | |
| public ServerWebSocket | pause()
Redeclares io. Pause the |
| public @Nullable String | |
| public void | |
| public void | reject(int status)
Deprecated
instead use
ServerWebSocketHandshake#reject(int)
Like |
| public ServerWebSocket | resume()
Redeclares io. Resume reading, and sets the buffer in |
| public @Nullable String | |
| public void | setHandshake(Future<Integer>
the future to complete with future, Handler<AsyncResult<Integer>> the completion handler handler)
Deprecated
instead use
ServerWebSocketHandshake
Set an asynchronous result for the handshake, upon completion of the specified
|
| public Future | setHandshake(Future<Integer> future)
Deprecated
instead use
ServerWebSocketHandshake
Like |
| public ServerWebSocket | 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.Redeclares io.
|
| public String | |
| public ServerWebSocket | writeBinaryMessage(Buffer data, Handler<AsyncResult<Void>> handler)
Redeclares io.
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Same as |
| public ServerWebSocket | writeFinalBinaryFrame(Buffer data, Handler<AsyncResult<Void>> handler)
Redeclares io.
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Same as |
| public ServerWebSocket | writeFinalTextFrame(String text, Handler<AsyncResult<Void>> handler)
Redeclares io. Same as |
| public ServerWebSocket | writeFrame(WebSocketFrame frame, Handler<AsyncResult<Void>> handler)
Redeclares io. Same as |
| public ServerWebSocket | writePing(Buffer
the data to write, may be at most 125 bytes data, Handler<AsyncResult<Void>> called when the ping frame has been successfully written handler)Redeclares io.
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Writes a ping frame to the connection. |
| public ServerWebSocket | writePong(Buffer
the data to write, may be at most 125 bytes data, Handler<AsyncResult<Void>> called when the pong frame has been successfully written handler)Redeclares io.
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Writes a pong frame to the connection. |
| public ServerWebSocket | writeTextMessage(String text, Handler<AsyncResult<Void>> handler)
Redeclares io. Same as |
| accept | back to summary |
|---|---|
| public void accept()
Deprecated instead use Accept the WebSocket and terminate the WebSocket handshake. This method should be called from the WebSocket handler to explicitly accept the WebSocket and terminate the WebSocket handshake.
| |
| authority | back to summary |
|---|---|
public @Nullable HostAndPort authority()
| |
| close | back to summary |
|---|---|
| public Future Redeclares io. Doc from io. Close the WebSocket sending the default close frame. No more messages can be sent. The WebSocket handshake will be accepted when it hasn't yet been settled or when an asynchronous handshake is in progress. | |
| closeHandler | back to summary |
|---|---|
public ServerWebSocket closeHandler(Handler<Void> handler)
| |
| drainHandler | back to summary |
|---|---|
| public ServerWebSocket drainHandler(Handler<Void> handler) Redeclares io.
| |
| endHandler | back to summary |
|---|---|
| public ServerWebSocket endHandler(Handler<Void> endHandler) Redeclares io.
| |
| exceptionHandler | back to summary |
|---|---|
| public ServerWebSocket exceptionHandler(Handler<Throwable> handler) Redeclares io.
| |
| fetch | back to summary |
|---|---|
| public ServerWebSocket fetch(long amount) Redeclares io. Doc from io. Fetch the specified
| |
| frameHandler | back to summary |
|---|---|
public ServerWebSocket frameHandler(Handler<WebSocketFrame> handler)
| |
| handler | back to summary |
|---|---|
| public ServerWebSocket handler(Handler<Buffer> handler) Redeclares io.
| |
| host | back to summary |
|---|---|
| public @Nullable String host()
Deprecated use | |
| path | back to summary |
|---|---|
public String path()
| |
| pause | back to summary |
|---|---|
| public ServerWebSocket pause() Redeclares io. Doc from io. Pause the
While it's paused, no data will be sent to the data
| |
| query | back to summary |
|---|---|
| public @Nullable String query() | |
| reject | back to summary |
|---|---|
| public void reject()
Deprecated instead use Reject the WebSocket. Calling this method from the WebSocket handler when it is first passed to you gives you the opportunity to reject the WebSocket, which will cause the WebSocket handshake to fail by returning a 502 response code. You might use this method, if for example you only want to accept WebSockets with a particular path.
| |
| reject | back to summary |
|---|---|
| public void reject(int status)
Deprecated instead use Like
| |
| resume | back to summary |
|---|---|
| public ServerWebSocket resume() Redeclares io. Doc from io. Resume reading, and sets the buffer in
If the
| |
| scheme | back to summary |
|---|---|
| public @Nullable String scheme() | |
| setHandshake | back to summary |
|---|---|
| public void setHandshake(Future<Integer> future, Handler<AsyncResult<Integer>> handler)
Deprecated instead use Set an asynchronous result for the handshake, upon completion of the specified
close() method
will try to accept the handshake and close the WebSocket afterward. Thus it is advised to try to complete
the future with Promise#tryComplete or Promise#tryFail.
This method should be called from the WebSocket handler to explicitly set an asynchronous handshake.
Calling this method will override the
| |
| setHandshake | back to summary |
|---|---|
| public Future Deprecated instead use Like
| |
| setWriteQueueMaxSize | back to summary |
|---|---|
| public ServerWebSocket 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() Redeclares io.
| |
| uri | back to summary |
|---|---|
| public String uri() | |
| writeBinaryMessage | back to summary |
|---|---|
| public ServerWebSocket writeBinaryMessage(Buffer data, Handler<AsyncResult<Void>> handler) Redeclares io. Doc from io. References Deprecated
See corresponding docs for further information. Same as
| |
| writeFinalBinaryFrame | back to summary |
|---|---|
| public ServerWebSocket writeFinalBinaryFrame(Buffer data, Handler<AsyncResult<Void>> handler) Redeclares io. Doc from io. References Deprecated
See corresponding docs for further information. Same as
| |
| writeFinalTextFrame | back to summary |
|---|---|
| public ServerWebSocket writeFinalTextFrame(String text, Handler<AsyncResult<Void>> handler) Redeclares io. Doc from io. Same as
| |
| writeFrame | back to summary |
|---|---|
| public ServerWebSocket writeFrame(WebSocketFrame frame, Handler<AsyncResult<Void>> handler) Redeclares io. Doc from io. Same as
| |
| writePing | back to summary |
|---|---|
| public ServerWebSocket writePing(Buffer data, Handler<AsyncResult<Void>> handler) Redeclares io. Doc from io. 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.
| |
| writePong | back to summary |
|---|---|
| public ServerWebSocket writePong(Buffer data, Handler<AsyncResult<Void>> handler) Redeclares io. Doc from io. 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.
| |
| writeTextMessage | back to summary |
|---|---|
| public ServerWebSocket writeTextMessage(String text, Handler<AsyncResult<Void>> handler) Redeclares io. Doc from io. Same as
| |