Class ServerWebSocket
- All Implemented Interfaces:
MutinyDelegate,WebSocketBase,ReadStream<Buffer>,StreamBase,WriteStream<Buffer>
Instances of this class are passed into a HttpServer.webSocketHandler(java.util.function.Consumer<io.vertx.mutiny.core.http.ServerWebSocket>) or provided
when a WebSocket handshake is manually HttpServerRequest.toWebSocket()ed.
original non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionServerWebSocket(io.vertx.core.http.ServerWebSocket delegate) ServerWebSocket(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept()Deprecated.binaryMessageHandler(Consumer<Buffer> handler) io.smallrye.mutiny.Uni<Void>close()Same asclose()but with anhandlercalled when the operation completesio.smallrye.mutiny.Uni<Void>close(short statusCode) Same asWebSocketBase.close()but with anhandlercalled when the operation completesio.smallrye.mutiny.Uni<Void>Same asWebSocketBase.close()but with anhandlercalled when the operation completesBlocking variant ofWebSocketBase.close().closeAndAwait(short statusCode) Blocking variant ofWebSocketBase.close(short).closeAndAwait(short statusCode, String reason) Blocking variant ofWebSocketBase.close(short,String).voidVariant ofWebSocketBase.close()that ignores the result of the operation.voidcloseAndForget(short statusCode) Variant ofWebSocketBase.close(short)that ignores the result of the operation.voidcloseAndForget(short statusCode, String reason) Variant ofWebSocketBase.close(short,String)that ignores the result of the operation.closeHandler(Runnable handler) drainHandler(Runnable handler) io.smallrye.mutiny.Uni<Void>end()CallsWebSocketBase.close()io.smallrye.mutiny.Uni<Void>Same as but with anhandlercalled when the operation completesBlocking variant ofWebSocketBase.end(io.vertx.mutiny.core.buffer.Buffer).endAndAwait(Buffer data) Blocking variant ofio.vertx.mutiny.core.streams.WriteStream#end(io.vertx.mutiny.core.buffer.Buffer).voidVariant ofWebSocketBase.end(io.vertx.mutiny.core.buffer.Buffer)that ignores the result of the operation.voidendAndForget(Buffer data) Variant ofio.vertx.mutiny.core.streams.WriteStream#end(io.vertx.mutiny.core.buffer.Buffer)that ignores the result of the operation.endHandler(Runnable endHandler) booleanexceptionHandler(Consumer<Throwable> handler) fetch(long amount) frameHandler(Consumer<WebSocketFrame> handler) io.vertx.core.http.ServerWebSocketinthashCode()headers()host()Deprecated.useauthority()insteadbooleanisClosed()booleanisSsl()static ServerWebSocketnewInstance(io.vertx.core.http.ServerWebSocket arg) path()pause()pipe()io.smallrye.mutiny.Uni<Void>pipeTo(WriteStream<Buffer> dst) Pipe thisReadStreamto theWriteStream.pipeToAndAwait(WriteStream<Buffer> dst) Blocking variant ofReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream).voidpipeToAndForget(WriteStream<Buffer> dst) Variant ofReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)that ignores the result of the operation.pongHandler(Consumer<Buffer> handler) query()voidreject()Deprecated.instead useServerWebSocketHandshake.reject()voidreject(int status) Deprecated.instead useServerWebSocketHandshake.reject(int)resume()scheme()io.smallrye.mutiny.Uni<Integer>setHandshake(io.smallrye.mutiny.Uni<Integer> future) Deprecated.instead useServerWebSocketHandshakesetHandshakeAndAwait(io.smallrye.mutiny.Uni<Integer> future) Deprecated.instead useServerWebSocketHandshakevoidsetHandshakeAndForget(io.smallrye.mutiny.Uni<Integer> future) Deprecated.instead useServerWebSocketHandshakesetWriteQueueMaxSize(int maxSize) textMessageHandler(Consumer<String> handler) io.smallrye.mutiny.Multi<Buffer>toMulti()toString()uri()io.smallrye.mutiny.Uni<Void>Same as but with anhandlercalled when the operation completeswriteAndAwait(Buffer data) Blocking variant ofio.vertx.mutiny.core.streams.WriteStream#write(io.vertx.mutiny.core.buffer.Buffer).voidwriteAndForget(Buffer data) Variant ofio.vertx.mutiny.core.streams.WriteStream#write(io.vertx.mutiny.core.buffer.Buffer)that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>writeBinaryMessage(Buffer data) Same asWebSocketBase.writeBinaryMessage(io.vertx.mutiny.core.buffer.Buffer)but with anhandlercalled when the operation completesBlocking variant ofWebSocketBase.writeBinaryMessage(io.vertx.mutiny.core.buffer.Buffer).Variant ofWebSocketBase.writeBinaryMessage(io.vertx.mutiny.core.buffer.Buffer)that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>writeFinalBinaryFrame(Buffer data) Same asWebSocketBase.writeFinalBinaryFrame(io.vertx.mutiny.core.buffer.Buffer)but with anhandlercalled when the operation completesBlocking variant ofWebSocketBase.writeFinalBinaryFrame(io.vertx.mutiny.core.buffer.Buffer).Variant ofWebSocketBase.writeFinalBinaryFrame(io.vertx.mutiny.core.buffer.Buffer)that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>writeFinalTextFrame(String text) Same asWebSocketBase.writeFinalTextFrame(java.lang.String)but with anhandlercalled when the operation completesBlocking variant ofWebSocketBase.writeFinalTextFrame(String).Variant ofWebSocketBase.writeFinalTextFrame(String)that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>writeFrame(WebSocketFrame frame) Same asWebSocketBase.writeFrame(io.vertx.mutiny.core.http.WebSocketFrame)but with anhandlercalled when the operation completeswriteFrameAndAwait(WebSocketFrame frame) Blocking variant ofWebSocketBase.writeFrame(io.vertx.mutiny.core.http.WebSocketFrame).Variant ofWebSocketBase.writeFrame(io.vertx.mutiny.core.http.WebSocketFrame)that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>Writes a ping frame to the connection.writePingAndAwait(Buffer data) Blocking variant ofWebSocketBase.writePing(io.vertx.mutiny.core.buffer.Buffer).writePingAndForget(Buffer data) Variant ofWebSocketBase.writePing(io.vertx.mutiny.core.buffer.Buffer)that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>Writes a pong frame to the connection.writePongAndAwait(Buffer data) Blocking variant ofWebSocketBase.writePong(io.vertx.mutiny.core.buffer.Buffer).writePongAndForget(Buffer data) Variant ofWebSocketBase.writePong(io.vertx.mutiny.core.buffer.Buffer)that ignores the result of the operation.booleanio.smallrye.mutiny.Uni<Void>writeTextMessage(String text) Same asWebSocketBase.writeTextMessage(java.lang.String)but with anhandlercalled when the operation completesBlocking variant ofWebSocketBase.writeTextMessage(String).Variant ofWebSocketBase.writeTextMessage(String)that ignores the result of the operation.
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
ServerWebSocket
public ServerWebSocket(io.vertx.core.http.ServerWebSocket delegate) -
ServerWebSocket
-
-
Method Details
-
getDelegate
public io.vertx.core.http.ServerWebSocket getDelegate()- Specified by:
getDelegatein interfaceMutinyDelegate- Specified by:
getDelegatein interfaceReadStream<Buffer>- Specified by:
getDelegatein interfaceStreamBase- Specified by:
getDelegatein interfaceWebSocketBase- Specified by:
getDelegatein interfaceWriteStream<Buffer>- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
toSubscriber
-
write
Same as but with anhandlercalled when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
writein interfaceWebSocketBase- Specified by:
writein interfaceWriteStream<Buffer>- Parameters:
data-- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
writeAndAwait
Blocking variant ofio.vertx.mutiny.core.streams.WriteStream#write(io.vertx.mutiny.core.buffer.Buffer).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
writeAndAwaitin interfaceWebSocketBase- Specified by:
writeAndAwaitin interfaceWriteStream<Buffer>- Parameters:
data-- Returns:
- the Void instance produced by the operation.
-
writeAndForget
Variant ofio.vertx.mutiny.core.streams.WriteStream#write(io.vertx.mutiny.core.buffer.Buffer)that ignores the result of the operation.This method subscribes on the result of
io.vertx.mutiny.core.streams.WriteStream#write(io.vertx.mutiny.core.buffer.Buffer), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromio.vertx.mutiny.core.streams.WriteStream#write(io.vertx.mutiny.core.buffer.Buffer)but you don't need to compose it with other operations.- Specified by:
writeAndForgetin interfaceWebSocketBase- Specified by:
writeAndForgetin interfaceWriteStream<Buffer>- Parameters:
data-
-
end
Same as but with anhandlercalled when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
endin interfaceWebSocketBase- Specified by:
endin interfaceWriteStream<Buffer>- Parameters:
data-- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
endAndAwait
Blocking variant ofio.vertx.mutiny.core.streams.WriteStream#end(io.vertx.mutiny.core.buffer.Buffer).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
endAndAwaitin interfaceWebSocketBase- Specified by:
endAndAwaitin interfaceWriteStream<Buffer>- Parameters:
data-- Returns:
- the Void instance produced by the operation.
-
endAndForget
Variant ofio.vertx.mutiny.core.streams.WriteStream#end(io.vertx.mutiny.core.buffer.Buffer)that ignores the result of the operation.This method subscribes on the result of
io.vertx.mutiny.core.streams.WriteStream#end(io.vertx.mutiny.core.buffer.Buffer), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromio.vertx.mutiny.core.streams.WriteStream#end(io.vertx.mutiny.core.buffer.Buffer)but you don't need to compose it with other operations.- Specified by:
endAndForgetin interfaceWebSocketBase- Specified by:
endAndForgetin interfaceWriteStream<Buffer>- Parameters:
data-
-
writeQueueFull
public boolean writeQueueFull()- Specified by:
writeQueueFullin interfaceWebSocketBase- Specified by:
writeQueueFullin interfaceWriteStream<Buffer>- Returns:
trueif write queue is full
-
pipe
- Specified by:
pipein interfaceReadStream<Buffer>- Specified by:
pipein interfaceWebSocketBase- Returns:
- a pipe
-
pipeTo
Pipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the
handlerwill be called with the result.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
pipeToin interfaceReadStream<Buffer>- Specified by:
pipeToin interfaceWebSocketBase- Parameters:
dst- the destination write stream- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
pipeToAndAwait
Blocking variant ofReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
pipeToAndAwaitin interfaceReadStream<Buffer>- Specified by:
pipeToAndAwaitin interfaceWebSocketBase- Parameters:
dst- the destination write stream- Returns:
- the Void instance produced by the operation.
-
pipeToAndForget
Variant ofReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)that ignores the result of the operation.This method subscribes on the result of
ReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)but you don't need to compose it with other operations.- Specified by:
pipeToAndForgetin interfaceReadStream<Buffer>- Specified by:
pipeToAndForgetin interfaceWebSocketBase- Parameters:
dst- the destination write stream
-
binaryHandlerID
- Specified by:
binaryHandlerIDin interfaceWebSocketBase- Returns:
- the binary handler id
-
textHandlerID
- Specified by:
textHandlerIDin interfaceWebSocketBase- Returns:
- the text handler id
-
subProtocol
- Specified by:
subProtocolin interfaceWebSocketBase- Returns:
-
closeStatusCode
- Specified by:
closeStatusCodein interfaceWebSocketBase- Returns:
-
closeReason
- Specified by:
closeReasonin interfaceWebSocketBase- Returns:
-
headers
- Specified by:
headersin interfaceWebSocketBase- Returns:
- the headers
-
textMessageHandler
- Specified by:
textMessageHandlerin interfaceWebSocketBase- Parameters:
handler- the handler- Returns:
-
binaryMessageHandler
- Specified by:
binaryMessageHandlerin interfaceWebSocketBase- Parameters:
handler- the handler- Returns:
-
pongHandler
- Specified by:
pongHandlerin interfaceWebSocketBase- Parameters:
handler- the handler- Returns:
-
end
CallsWebSocketBase.close()Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
endin interfaceWebSocketBase- Specified by:
endin interfaceWriteStream<Buffer>- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
endAndAwait
Blocking variant ofWebSocketBase.end(io.vertx.mutiny.core.buffer.Buffer).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
endAndAwaitin interfaceWebSocketBase- Specified by:
endAndAwaitin interfaceWriteStream<Buffer>- Returns:
- the Void instance produced by the operation.
-
endAndForget
public void endAndForget()Variant ofWebSocketBase.end(io.vertx.mutiny.core.buffer.Buffer)that ignores the result of the operation.This method subscribes on the result of
WebSocketBase.end(io.vertx.mutiny.core.buffer.Buffer), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromWebSocketBase.end(io.vertx.mutiny.core.buffer.Buffer)but you don't need to compose it with other operations.- Specified by:
endAndForgetin interfaceWebSocketBase- Specified by:
endAndForgetin interfaceWriteStream<Buffer>
-
close
Same asclose()but with anhandlercalled when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
closein interfaceWebSocketBase- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
closeAndAwait
Blocking variant ofWebSocketBase.close().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
closeAndAwaitin interfaceWebSocketBase- Returns:
- the Void instance produced by the operation.
-
closeAndForget
public void closeAndForget()Variant ofWebSocketBase.close()that ignores the result of the operation.This method subscribes on the result of
WebSocketBase.close(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromWebSocketBase.close()but you don't need to compose it with other operations.- Specified by:
closeAndForgetin interfaceWebSocketBase
-
close
Same asWebSocketBase.close()but with anhandlercalled when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
closein interfaceWebSocketBase- Parameters:
statusCode-- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
closeAndAwait
Blocking variant ofWebSocketBase.close(short).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
closeAndAwaitin interfaceWebSocketBase- Parameters:
statusCode-- Returns:
- the Void instance produced by the operation.
-
closeAndForget
public void closeAndForget(short statusCode) Variant ofWebSocketBase.close(short)that ignores the result of the operation.This method subscribes on the result of
WebSocketBase.close(short), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromWebSocketBase.close(short)but you don't need to compose it with other operations.- Specified by:
closeAndForgetin interfaceWebSocketBase- Parameters:
statusCode-
-
close
Same asWebSocketBase.close()but with anhandlercalled when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
closein interfaceWebSocketBase- Parameters:
statusCode-reason-- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
closeAndAwait
Blocking variant ofWebSocketBase.close(short,String).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
closeAndAwaitin interfaceWebSocketBase- Parameters:
statusCode-reason-- Returns:
- the Void instance produced by the operation.
-
closeAndForget
Variant ofWebSocketBase.close(short,String)that ignores the result of the operation.This method subscribes on the result of
WebSocketBase.close(short,String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromWebSocketBase.close(short,String)but you don't need to compose it with other operations.- Specified by:
closeAndForgetin interfaceWebSocketBase- Parameters:
statusCode-reason-
-
remoteAddress
- Specified by:
remoteAddressin interfaceWebSocketBase- Returns:
- the remote address for this connection, possibly
null(e.g a server bound on a domain socket). IfuseProxyProtocolis set totrue, the address returned will be of the actual connecting client.
-
localAddress
- Specified by:
localAddressin interfaceWebSocketBase- Returns:
- the local address for this connection, possibly
null(e.g a server bound on a domain socket) IfuseProxyProtocolis set totrue, the address returned will be of the proxy.
-
isSsl
public boolean isSsl()- Specified by:
isSslin interfaceWebSocketBase- Returns:
- true if this
HttpConnectionis encrypted via SSL/TLS.
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceWebSocketBase- Returns:
trueif the WebSocket is closed
-
exceptionHandler
- Specified by:
exceptionHandlerin interfaceReadStream<Buffer>- Specified by:
exceptionHandlerin interfaceStreamBase- Specified by:
exceptionHandlerin interfaceWebSocketBase- Specified by:
exceptionHandlerin interfaceWriteStream<Buffer>- Parameters:
handler- the exception handler- Returns:
-
handler
- Specified by:
handlerin interfaceReadStream<Buffer>- Specified by:
handlerin interfaceWebSocketBase- Returns:
-
pause
- Specified by:
pausein interfaceReadStream<Buffer>- Specified by:
pausein interfaceWebSocketBase- Returns:
- a reference to this, so the API can be used fluently
-
resume
- Specified by:
resumein interfaceReadStream<Buffer>- Specified by:
resumein interfaceWebSocketBase- Returns:
- a reference to this, so the API can be used fluently
-
fetch
- Specified by:
fetchin interfaceReadStream<Buffer>- Specified by:
fetchin interfaceWebSocketBase- Returns:
- a reference to this, so the API can be used fluently
-
endHandler
- Specified by:
endHandlerin interfaceReadStream<Buffer>- Specified by:
endHandlerin interfaceWebSocketBase- Returns:
-
setWriteQueueMaxSize
- Specified by:
setWriteQueueMaxSizein interfaceWebSocketBase- Specified by:
setWriteQueueMaxSizein interfaceWriteStream<Buffer>- Parameters:
maxSize- the max size of the write stream- Returns:
- a reference to this, so the API can be used fluently
-
drainHandler
- Specified by:
drainHandlerin interfaceWebSocketBase- Specified by:
drainHandlerin interfaceWriteStream<Buffer>- Parameters:
handler- the handler- Returns:
-
writeFrame
Description copied from interface:WebSocketBaseSame asWebSocketBase.writeFrame(io.vertx.mutiny.core.http.WebSocketFrame)but with anhandlercalled when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
writeFramein interfaceWebSocketBase- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
writeFrameAndAwait
Description copied from interface:WebSocketBaseBlocking variant ofWebSocketBase.writeFrame(io.vertx.mutiny.core.http.WebSocketFrame).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
writeFrameAndAwaitin interfaceWebSocketBase- Returns:
- the Void instance produced by the operation.
-
writeFrameAndForget
Description copied from interface:WebSocketBaseVariant ofWebSocketBase.writeFrame(io.vertx.mutiny.core.http.WebSocketFrame)that ignores the result of the operation.This method subscribes on the result of
WebSocketBase.writeFrame(io.vertx.mutiny.core.http.WebSocketFrame), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromWebSocketBase.writeFrame(io.vertx.mutiny.core.http.WebSocketFrame)but you don't need to compose it with other operations.- Specified by:
writeFrameAndForgetin interfaceWebSocketBase- Returns:
- the instance of WebSocketBase to chain method calls.
-
writeFinalTextFrame
Description copied from interface:WebSocketBaseSame asWebSocketBase.writeFinalTextFrame(java.lang.String)but with anhandlercalled when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
writeFinalTextFramein interfaceWebSocketBase- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
writeFinalTextFrameAndAwait
Description copied from interface:WebSocketBaseBlocking variant ofWebSocketBase.writeFinalTextFrame(String).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
writeFinalTextFrameAndAwaitin interfaceWebSocketBase- Returns:
- the Void instance produced by the operation.
-
writeFinalTextFrameAndForget
Description copied from interface:WebSocketBaseVariant ofWebSocketBase.writeFinalTextFrame(String)that ignores the result of the operation.This method subscribes on the result of
WebSocketBase.writeFinalTextFrame(String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromWebSocketBase.writeFinalTextFrame(String)but you don't need to compose it with other operations.- Specified by:
writeFinalTextFrameAndForgetin interfaceWebSocketBase- Returns:
- the instance of WebSocketBase to chain method calls.
-
writeFinalBinaryFrame
Description copied from interface:WebSocketBaseSame asWebSocketBase.writeFinalBinaryFrame(io.vertx.mutiny.core.buffer.Buffer)but with anhandlercalled when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
writeFinalBinaryFramein interfaceWebSocketBase- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
writeFinalBinaryFrameAndAwait
Description copied from interface:WebSocketBaseBlocking variant ofWebSocketBase.writeFinalBinaryFrame(io.vertx.mutiny.core.buffer.Buffer).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
writeFinalBinaryFrameAndAwaitin interfaceWebSocketBase- Returns:
- the Void instance produced by the operation.
-
writeFinalBinaryFrameAndForget
Description copied from interface:WebSocketBaseVariant ofWebSocketBase.writeFinalBinaryFrame(io.vertx.mutiny.core.buffer.Buffer)that ignores the result of the operation.This method subscribes on the result of
WebSocketBase.writeFinalBinaryFrame(io.vertx.mutiny.core.buffer.Buffer), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromWebSocketBase.writeFinalBinaryFrame(io.vertx.mutiny.core.buffer.Buffer)but you don't need to compose it with other operations.- Specified by:
writeFinalBinaryFrameAndForgetin interfaceWebSocketBase- Returns:
- the instance of WebSocketBase to chain method calls.
-
writeBinaryMessage
Description copied from interface:WebSocketBaseSame asWebSocketBase.writeBinaryMessage(io.vertx.mutiny.core.buffer.Buffer)but with anhandlercalled when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
writeBinaryMessagein interfaceWebSocketBase- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
writeBinaryMessageAndAwait
Description copied from interface:WebSocketBaseBlocking variant ofWebSocketBase.writeBinaryMessage(io.vertx.mutiny.core.buffer.Buffer).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
writeBinaryMessageAndAwaitin interfaceWebSocketBase- Returns:
- the Void instance produced by the operation.
-
writeBinaryMessageAndForget
Description copied from interface:WebSocketBaseVariant ofWebSocketBase.writeBinaryMessage(io.vertx.mutiny.core.buffer.Buffer)that ignores the result of the operation.This method subscribes on the result of
WebSocketBase.writeBinaryMessage(io.vertx.mutiny.core.buffer.Buffer), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromWebSocketBase.writeBinaryMessage(io.vertx.mutiny.core.buffer.Buffer)but you don't need to compose it with other operations.- Specified by:
writeBinaryMessageAndForgetin interfaceWebSocketBase- Returns:
- the instance of WebSocketBase to chain method calls.
-
writeTextMessage
Description copied from interface:WebSocketBaseSame asWebSocketBase.writeTextMessage(java.lang.String)but with anhandlercalled when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
writeTextMessagein interfaceWebSocketBase- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
writeTextMessageAndAwait
Description copied from interface:WebSocketBaseBlocking variant ofWebSocketBase.writeTextMessage(String).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
writeTextMessageAndAwaitin interfaceWebSocketBase- Returns:
- the Void instance produced by the operation.
-
writeTextMessageAndForget
Description copied from interface:WebSocketBaseVariant ofWebSocketBase.writeTextMessage(String)that ignores the result of the operation.This method subscribes on the result of
WebSocketBase.writeTextMessage(String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromWebSocketBase.writeTextMessage(String)but you don't need to compose it with other operations.- Specified by:
writeTextMessageAndForgetin interfaceWebSocketBase- Returns:
- the instance of WebSocketBase to chain method calls.
-
writePing
Description copied from interface:WebSocketBaseWrites 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.
Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
writePingin interfaceWebSocketBase- Parameters:
data- the data to write, may be at most 125 bytes- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
writePingAndAwait
Description copied from interface:WebSocketBaseBlocking variant ofWebSocketBase.writePing(io.vertx.mutiny.core.buffer.Buffer).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
writePingAndAwaitin interfaceWebSocketBase- Parameters:
data- the data to write, may be at most 125 bytes- Returns:
- the Void instance produced by the operation.
-
writePingAndForget
Description copied from interface:WebSocketBaseVariant ofWebSocketBase.writePing(io.vertx.mutiny.core.buffer.Buffer)that ignores the result of the operation.This method subscribes on the result of
WebSocketBase.writePing(io.vertx.mutiny.core.buffer.Buffer), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromWebSocketBase.writePing(io.vertx.mutiny.core.buffer.Buffer)but you don't need to compose it with other operations.- Specified by:
writePingAndForgetin interfaceWebSocketBase- Parameters:
data- the data to write, may be at most 125 bytes- Returns:
- the instance of WebSocketBase to chain method calls.
-
writePong
Description copied from interface:WebSocketBaseWrites 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.
Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
writePongin interfaceWebSocketBase- Parameters:
data- the data to write, may be at most 125 bytes- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
writePongAndAwait
Description copied from interface:WebSocketBaseBlocking variant ofWebSocketBase.writePong(io.vertx.mutiny.core.buffer.Buffer).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
writePongAndAwaitin interfaceWebSocketBase- Parameters:
data- the data to write, may be at most 125 bytes- Returns:
- the Void instance produced by the operation.
-
writePongAndForget
Description copied from interface:WebSocketBaseVariant ofWebSocketBase.writePong(io.vertx.mutiny.core.buffer.Buffer)that ignores the result of the operation.This method subscribes on the result of
WebSocketBase.writePong(io.vertx.mutiny.core.buffer.Buffer), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromWebSocketBase.writePong(io.vertx.mutiny.core.buffer.Buffer)but you don't need to compose it with other operations.- Specified by:
writePongAndForgetin interfaceWebSocketBase- Parameters:
data- the data to write, may be at most 125 bytes- Returns:
- the instance of WebSocketBase to chain method calls.
-
closeHandler
- Specified by:
closeHandlerin interfaceWebSocketBase- Parameters:
handler- the handler- Returns:
-
frameHandler
- Specified by:
frameHandlerin interfaceWebSocketBase- Parameters:
handler- the handler- Returns:
-
scheme
- Returns:
- the WebSocket handshake scheme
-
host
Deprecated.useauthority()instead- Returns:
- the WebSocket handshake host
-
authority
- Returns:
- the WebSocket handshake authority
-
uri
-
path
- Returns:
- the WebSocket handshake path.
-
query
- Returns:
- the WebSocket handshake query string.
-
accept
Deprecated.instead useServerWebSocketHandshake.accept() -
reject
Deprecated.instead useServerWebSocketHandshake.reject() -
reject
Deprecated.instead useServerWebSocketHandshake.reject(int)- Parameters:
status-
-
setHandshake
@CheckReturnValue @Deprecated public io.smallrye.mutiny.Uni<Integer> setHandshake(io.smallrye.mutiny.Uni<Integer> future) Deprecated.instead useServerWebSocketHandshakeSet an asynchronous result for the handshake, upon completion of the specifiedfuture, the WebSocket will either be- accepted when the
futuresucceeds with the HTTP status code - rejected when the
futureis succeeds with an HTTP status code different than - rejected when the
futurefails with the HTTP status code500
close()method will try to accept the handshake and close the WebSocket afterward. Thus it is advised to try to complete thefuturewith or .This method should be called from the WebSocket handler to explicitly set an asynchronous handshake.
Calling this method will override the
futurecompletion handler.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
future- the future to complete with- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
- accepted when the
-
setHandshakeAndAwait
Deprecated.instead useServerWebSocketHandshakeBlocking variant ofio.vertx.mutiny.core.http.ServerWebSocket#setHandshake(Future).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
future- the future to complete with- Returns:
- the Integer instance produced by the operation.
-
setHandshakeAndForget
Deprecated.instead useServerWebSocketHandshakeVariant ofio.vertx.mutiny.core.http.ServerWebSocket#setHandshake(Future)that ignores the result of the operation.This method subscribes on the result of
io.vertx.mutiny.core.http.ServerWebSocket#setHandshake(Future), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromio.vertx.mutiny.core.http.ServerWebSocket#setHandshake(Future)but you don't need to compose it with other operations.- Parameters:
future- the future to complete with
-
sslSession
- Specified by:
sslSessionin interfaceWebSocketBase- Returns:
- SSLSession associated with the underlying socket. Returns null if connection is not SSL.
-
toMulti
- Specified by:
toMultiin interfaceReadStream<Buffer>
-
toBlockingIterable
-
toBlockingStream
-
newInstance
-
ServerWebSocketHandshake.accept()