Class ClientWebSocket
- All Implemented Interfaces:
MutinyDelegate
,WebSocketBase
,ReadStream<Buffer>
,StreamBase
,WriteStream<Buffer>
original
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionClientWebSocket
(io.vertx.core.http.ClientWebSocket delegate) ClientWebSocket
(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionbinaryMessageHandler
(Consumer<Buffer> handler) io.smallrye.mutiny.Uni<Void>
close()
Same asWebSocketBase.close()
but with anhandler
called when the operation completesio.smallrye.mutiny.Uni<Void>
close
(short statusCode) Same asWebSocketBase.close()
but with anhandler
called when the operation completesio.smallrye.mutiny.Uni<Void>
Same asWebSocketBase.close()
but with anhandler
called 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)
.void
Variant ofWebSocketBase.close()
that ignores the result of the operation.void
closeAndForget
(short statusCode) Variant ofWebSocketBase.close(short)
that ignores the result of the operation.void
closeAndForget
(short statusCode, String reason) Variant ofWebSocketBase.close(short,String)
that ignores the result of the operation.closeHandler
(Runnable handler) io.smallrye.mutiny.Uni<WebSocket>
Connect a WebSocket to the specified port, host and relative request URIio.smallrye.mutiny.Uni<WebSocket>
connect
(io.vertx.core.http.WebSocketConnectOptions options) Connect a WebSocket with the specified options.io.smallrye.mutiny.Uni<WebSocket>
Connect this WebSocket at the relative request URI using the default host and port.io.smallrye.mutiny.Uni<WebSocket>
Connect this WebSocket to the host and relative request URI and default port.connectAndAwait
(int port, String host, String requestURI) Blocking variant ofconnect(int,String,String)
.connectAndAwait
(io.vertx.core.http.WebSocketConnectOptions options) Blocking variant ofconnect(WebSocketConnectOptions)
.connectAndAwait
(String requestURI) Blocking variant ofconnect(String)
.connectAndAwait
(String host, String requestURI) Blocking variant ofconnect(String,String)
.void
connectAndForget
(int port, String host, String requestURI) Variant ofconnect(int,String,String)
that ignores the result of the operation.void
connectAndForget
(io.vertx.core.http.WebSocketConnectOptions options) Variant ofconnect(WebSocketConnectOptions)
that ignores the result of the operation.void
connectAndForget
(String requestURI) Variant ofconnect(String)
that ignores the result of the operation.void
connectAndForget
(String host, String requestURI) Variant ofconnect(String,String)
that ignores the result of the operation.drainHandler
(Runnable handler) io.smallrye.mutiny.Uni<Void>
end()
CallsWebSocketBase.close()
io.smallrye.mutiny.Uni<Void>
Same as but with anhandler
called 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)
.void
Variant ofWebSocketBase.end(io.vertx.mutiny.core.buffer.Buffer)
that ignores the result of the operation.void
endAndForget
(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) boolean
exceptionHandler
(Consumer<Throwable> handler) frameHandler
(Consumer<WebSocketFrame> handler) io.vertx.core.http.ClientWebSocket
int
hashCode()
headers()
boolean
isClosed()
boolean
isSsl()
static ClientWebSocket
newInstance
(io.vertx.core.http.ClientWebSocket arg) pipe()
io.smallrye.mutiny.Uni<Void>
pipeTo
(WriteStream<Buffer> dst) Pipe thisReadStream
to theWriteStream
.pipeToAndAwait
(WriteStream<Buffer> dst) Blocking variant ofReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)
.void
pipeToAndForget
(WriteStream<Buffer> dst) Variant ofReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)
that ignores the result of the operation.pongHandler
(Consumer<Buffer> handler) textMessageHandler
(Consumer<String> handler) io.smallrye.mutiny.Multi<Buffer>
toMulti()
toString()
io.smallrye.mutiny.Uni<Void>
Same as but with anhandler
called when the operation completeswriteAndAwait
(Buffer data) Blocking variant ofio.vertx.mutiny.core.streams.WriteStream#write(io.vertx.mutiny.core.buffer.Buffer)
.void
writeAndForget
(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 anhandler
called 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 anhandler
called 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 anhandler
called 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 anhandler
called 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.boolean
io.smallrye.mutiny.Uni<Void>
writeTextMessage
(String text) Same asWebSocketBase.writeTextMessage(java.lang.String)
but with anhandler
called when the operation completesBlocking variant ofWebSocketBase.writeTextMessage(String)
.Variant ofWebSocketBase.writeTextMessage(String)
that ignores the result of the operation.Methods inherited from class io.vertx.mutiny.core.http.WebSocket
fetch, newInstance, pause, resume, setWriteQueueMaxSize
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
ClientWebSocket
public ClientWebSocket(io.vertx.core.http.ClientWebSocket delegate) -
ClientWebSocket
-
-
Method Details
-
getDelegate
public io.vertx.core.http.ClientWebSocket getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Specified by:
getDelegate
in interfaceReadStream<Buffer>
- Specified by:
getDelegate
in interfaceStreamBase
- Specified by:
getDelegate
in interfaceWebSocketBase
- Specified by:
getDelegate
in interfaceWriteStream<Buffer>
- Overrides:
getDelegate
in classWebSocket
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
toSubscriber
- Overrides:
toSubscriber
in classWebSocket
-
write
Same as but with anhandler
called 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:
write
in interfaceWebSocketBase
- Specified by:
write
in interfaceWriteStream<Buffer>
- Overrides:
write
in classWebSocket
- Parameters:
data
-- Returns:
- the
uni
firing 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:
writeAndAwait
in interfaceWebSocketBase
- Specified by:
writeAndAwait
in interfaceWriteStream<Buffer>
- Overrides:
writeAndAwait
in classWebSocket
- 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:
writeAndForget
in interfaceWebSocketBase
- Specified by:
writeAndForget
in interfaceWriteStream<Buffer>
- Overrides:
writeAndForget
in classWebSocket
- Parameters:
data
-
-
end
Same as but with anhandler
called 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:
end
in interfaceWebSocketBase
- Specified by:
end
in interfaceWriteStream<Buffer>
- Overrides:
end
in classWebSocket
- Parameters:
data
-- Returns:
- the
uni
firing 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:
endAndAwait
in interfaceWebSocketBase
- Specified by:
endAndAwait
in interfaceWriteStream<Buffer>
- Overrides:
endAndAwait
in classWebSocket
- 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:
endAndForget
in interfaceWebSocketBase
- Specified by:
endAndForget
in interfaceWriteStream<Buffer>
- Overrides:
endAndForget
in classWebSocket
- Parameters:
data
-
-
writeQueueFull
public boolean writeQueueFull()- Specified by:
writeQueueFull
in interfaceWebSocketBase
- Specified by:
writeQueueFull
in interfaceWriteStream<Buffer>
- Overrides:
writeQueueFull
in classWebSocket
- Returns:
true
if write queue is full
-
pipe
- Specified by:
pipe
in interfaceReadStream<Buffer>
- Specified by:
pipe
in interfaceWebSocketBase
- Overrides:
pipe
in classWebSocket
- Returns:
- a pipe
-
pipeTo
Pipe thisReadStream
to 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
handler
will 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:
pipeTo
in interfaceReadStream<Buffer>
- Specified by:
pipeTo
in interfaceWebSocketBase
- Overrides:
pipeTo
in classWebSocket
- Parameters:
dst
- the destination write stream- Returns:
- the
uni
firing 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:
pipeToAndAwait
in interfaceReadStream<Buffer>
- Specified by:
pipeToAndAwait
in interfaceWebSocketBase
- Overrides:
pipeToAndAwait
in classWebSocket
- 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:
pipeToAndForget
in interfaceReadStream<Buffer>
- Specified by:
pipeToAndForget
in interfaceWebSocketBase
- Overrides:
pipeToAndForget
in classWebSocket
- Parameters:
dst
- the destination write stream
-
binaryHandlerID
- Specified by:
binaryHandlerID
in interfaceWebSocketBase
- Overrides:
binaryHandlerID
in classWebSocket
- Returns:
- the binary handler id
-
textHandlerID
- Specified by:
textHandlerID
in interfaceWebSocketBase
- Overrides:
textHandlerID
in classWebSocket
- Returns:
- the text handler id
-
subProtocol
- Specified by:
subProtocol
in interfaceWebSocketBase
- Overrides:
subProtocol
in classWebSocket
- Returns:
-
closeStatusCode
- Specified by:
closeStatusCode
in interfaceWebSocketBase
- Overrides:
closeStatusCode
in classWebSocket
- Returns:
-
closeReason
- Specified by:
closeReason
in interfaceWebSocketBase
- Overrides:
closeReason
in classWebSocket
- Returns:
-
headers
- Specified by:
headers
in interfaceWebSocketBase
- Overrides:
headers
in classWebSocket
- Returns:
- the headers
-
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:
end
in interfaceWebSocketBase
- Specified by:
end
in interfaceWriteStream<Buffer>
- Overrides:
end
in classWebSocket
- Returns:
- the
uni
firing 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:
endAndAwait
in interfaceWebSocketBase
- Specified by:
endAndAwait
in interfaceWriteStream<Buffer>
- Overrides:
endAndAwait
in classWebSocket
- 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:
endAndForget
in interfaceWebSocketBase
- Specified by:
endAndForget
in interfaceWriteStream<Buffer>
- Overrides:
endAndForget
in classWebSocket
-
close
Same asWebSocketBase.close()
but with anhandler
called 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:
close
in interfaceWebSocketBase
- Overrides:
close
in classWebSocket
- Returns:
- the
uni
firing 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:
closeAndAwait
in interfaceWebSocketBase
- Overrides:
closeAndAwait
in classWebSocket
- 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:
closeAndForget
in interfaceWebSocketBase
- Overrides:
closeAndForget
in classWebSocket
-
close
Same asWebSocketBase.close()
but with anhandler
called 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:
close
in interfaceWebSocketBase
- Overrides:
close
in classWebSocket
- Parameters:
statusCode
-- Returns:
- the
uni
firing 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:
closeAndAwait
in interfaceWebSocketBase
- Overrides:
closeAndAwait
in classWebSocket
- 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:
closeAndForget
in interfaceWebSocketBase
- Overrides:
closeAndForget
in classWebSocket
- Parameters:
statusCode
-
-
close
Same asWebSocketBase.close()
but with anhandler
called 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:
close
in interfaceWebSocketBase
- Overrides:
close
in classWebSocket
- Parameters:
statusCode
-reason
-- Returns:
- the
uni
firing 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:
closeAndAwait
in interfaceWebSocketBase
- Overrides:
closeAndAwait
in classWebSocket
- 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:
closeAndForget
in interfaceWebSocketBase
- Overrides:
closeAndForget
in classWebSocket
- Parameters:
statusCode
-reason
-
-
remoteAddress
- Specified by:
remoteAddress
in interfaceWebSocketBase
- Overrides:
remoteAddress
in classWebSocket
- Returns:
- the remote address for this connection, possibly
null
(e.g a server bound on a domain socket). IfuseProxyProtocol
is set totrue
, the address returned will be of the actual connecting client.
-
localAddress
- Specified by:
localAddress
in interfaceWebSocketBase
- Overrides:
localAddress
in classWebSocket
- Returns:
- the local address for this connection, possibly
null
(e.g a server bound on a domain socket) IfuseProxyProtocol
is set totrue
, the address returned will be of the proxy.
-
isSsl
public boolean isSsl()- Specified by:
isSsl
in interfaceWebSocketBase
- Overrides:
isSsl
in classWebSocket
- Returns:
- true if this
HttpConnection
is encrypted via SSL/TLS.
-
isClosed
public boolean isClosed()- Specified by:
isClosed
in interfaceWebSocketBase
- Overrides:
isClosed
in classWebSocket
- Returns:
true
if the WebSocket is closed
-
connect
@CheckReturnValue public io.smallrye.mutiny.Uni<WebSocket> connect(int port, String host, String requestURI) Connect a WebSocket to the specified port, host and relative request URIUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
port
- the porthost
- the hostrequestURI
- the relative URI- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
connectAndAwait
Blocking variant ofconnect(int,String,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).
- Parameters:
port
- the porthost
- the hostrequestURI
- the relative URI- Returns:
- the WebSocket instance produced by the operation.
-
connectAndForget
Variant ofconnect(int,String,String)
that ignores the result of the operation.This method subscribes on the result of
connect(int,String,String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromconnect(int,String,String)
but you don't need to compose it with other operations.- Parameters:
port
- the porthost
- the hostrequestURI
- the relative URI
-
connect
@CheckReturnValue public io.smallrye.mutiny.Uni<WebSocket> connect(io.vertx.core.http.WebSocketConnectOptions options) Connect a WebSocket with the specified options.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
options
- the request options- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
connectAndAwait
Blocking variant ofconnect(WebSocketConnectOptions)
.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:
options
- the request options- Returns:
- the WebSocket instance produced by the operation.
-
connectAndForget
public void connectAndForget(io.vertx.core.http.WebSocketConnectOptions options) Variant ofconnect(WebSocketConnectOptions)
that ignores the result of the operation.This method subscribes on the result of
connect(WebSocketConnectOptions)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromconnect(WebSocketConnectOptions)
but you don't need to compose it with other operations.- Parameters:
options
- the request options
-
connect
Connect this WebSocket to the host and relative request URI and default port.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
host
- the hostrequestURI
- the relative URI- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
connectAndAwait
Blocking variant ofconnect(String,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).
- Parameters:
host
- the hostrequestURI
- the relative URI- Returns:
- the WebSocket instance produced by the operation.
-
connectAndForget
Variant ofconnect(String,String)
that ignores the result of the operation.This method subscribes on the result of
connect(String,String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromconnect(String,String)
but you don't need to compose it with other operations.- Parameters:
host
- the hostrequestURI
- the relative URI
-
connect
Connect this WebSocket at the relative request URI using the default host and port.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
requestURI
- the relative URI- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
connectAndAwait
Blocking variant ofconnect(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).
- Parameters:
requestURI
- the relative URI- Returns:
- the WebSocket instance produced by the operation.
-
connectAndForget
Variant ofconnect(String)
that ignores the result of the operation.This method subscribes on the result of
connect(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromconnect(String)
but you don't need to compose it with other operations.- Parameters:
requestURI
- the relative URI
-
handler
- Specified by:
handler
in interfaceReadStream<Buffer>
- Specified by:
handler
in interfaceWebSocketBase
- Overrides:
handler
in classWebSocket
- Returns:
-
endHandler
- Specified by:
endHandler
in interfaceReadStream<Buffer>
- Specified by:
endHandler
in interfaceWebSocketBase
- Overrides:
endHandler
in classWebSocket
- Returns:
-
drainHandler
- Specified by:
drainHandler
in interfaceWebSocketBase
- Specified by:
drainHandler
in interfaceWriteStream<Buffer>
- Overrides:
drainHandler
in classWebSocket
- Parameters:
handler
- the handler- Returns:
-
closeHandler
- Specified by:
closeHandler
in interfaceWebSocketBase
- Overrides:
closeHandler
in classWebSocket
- Parameters:
handler
- the handler- Returns:
-
frameHandler
- Specified by:
frameHandler
in interfaceWebSocketBase
- Overrides:
frameHandler
in classWebSocket
- Parameters:
handler
- the handler- Returns:
-
textMessageHandler
- Specified by:
textMessageHandler
in interfaceWebSocketBase
- Overrides:
textMessageHandler
in classWebSocket
- Parameters:
handler
- the handler- Returns:
-
binaryMessageHandler
- Specified by:
binaryMessageHandler
in interfaceWebSocketBase
- Overrides:
binaryMessageHandler
in classWebSocket
- Parameters:
handler
- the handler- Returns:
-
pongHandler
- Specified by:
pongHandler
in interfaceWebSocketBase
- Overrides:
pongHandler
in classWebSocket
- Parameters:
handler
- the handler- Returns:
-
exceptionHandler
- Specified by:
exceptionHandler
in interfaceReadStream<Buffer>
- Specified by:
exceptionHandler
in interfaceStreamBase
- Specified by:
exceptionHandler
in interfaceWebSocketBase
- Specified by:
exceptionHandler
in interfaceWriteStream<Buffer>
- Overrides:
exceptionHandler
in classWebSocket
- Parameters:
handler
- the exception handler- Returns:
-
writeFrame
Description copied from interface:WebSocketBase
Same asWebSocketBase.writeFrame(io.vertx.mutiny.core.http.WebSocketFrame)
but with anhandler
called 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:
writeFrame
in interfaceWebSocketBase
- Overrides:
writeFrame
in classWebSocket
- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
writeFrameAndAwait
Description copied from interface:WebSocketBase
Blocking 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:
writeFrameAndAwait
in interfaceWebSocketBase
- Overrides:
writeFrameAndAwait
in classWebSocket
- Returns:
- the Void instance produced by the operation.
-
writeFrameAndForget
Description copied from interface:WebSocketBase
Variant 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:
writeFrameAndForget
in interfaceWebSocketBase
- Overrides:
writeFrameAndForget
in classWebSocket
- Returns:
- the instance of WebSocketBase to chain method calls.
-
writeFinalTextFrame
Description copied from interface:WebSocketBase
Same asWebSocketBase.writeFinalTextFrame(java.lang.String)
but with anhandler
called 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:
writeFinalTextFrame
in interfaceWebSocketBase
- Overrides:
writeFinalTextFrame
in classWebSocket
- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
writeFinalTextFrameAndAwait
Description copied from interface:WebSocketBase
Blocking 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:
writeFinalTextFrameAndAwait
in interfaceWebSocketBase
- Overrides:
writeFinalTextFrameAndAwait
in classWebSocket
- Returns:
- the Void instance produced by the operation.
-
writeFinalTextFrameAndForget
Description copied from interface:WebSocketBase
Variant 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:
writeFinalTextFrameAndForget
in interfaceWebSocketBase
- Overrides:
writeFinalTextFrameAndForget
in classWebSocket
- Returns:
- the instance of WebSocketBase to chain method calls.
-
writeFinalBinaryFrame
Description copied from interface:WebSocketBase
Same asWebSocketBase.writeFinalBinaryFrame(io.vertx.mutiny.core.buffer.Buffer)
but with anhandler
called 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:
writeFinalBinaryFrame
in interfaceWebSocketBase
- Overrides:
writeFinalBinaryFrame
in classWebSocket
- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
writeFinalBinaryFrameAndAwait
Description copied from interface:WebSocketBase
Blocking 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:
writeFinalBinaryFrameAndAwait
in interfaceWebSocketBase
- Overrides:
writeFinalBinaryFrameAndAwait
in classWebSocket
- Returns:
- the Void instance produced by the operation.
-
writeFinalBinaryFrameAndForget
Description copied from interface:WebSocketBase
Variant 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:
writeFinalBinaryFrameAndForget
in interfaceWebSocketBase
- Overrides:
writeFinalBinaryFrameAndForget
in classWebSocket
- Returns:
- the instance of WebSocketBase to chain method calls.
-
writeBinaryMessage
Description copied from interface:WebSocketBase
Same asWebSocketBase.writeBinaryMessage(io.vertx.mutiny.core.buffer.Buffer)
but with anhandler
called 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:
writeBinaryMessage
in interfaceWebSocketBase
- Overrides:
writeBinaryMessage
in classWebSocket
- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
writeBinaryMessageAndAwait
Description copied from interface:WebSocketBase
Blocking 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:
writeBinaryMessageAndAwait
in interfaceWebSocketBase
- Overrides:
writeBinaryMessageAndAwait
in classWebSocket
- Returns:
- the Void instance produced by the operation.
-
writeBinaryMessageAndForget
Description copied from interface:WebSocketBase
Variant 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:
writeBinaryMessageAndForget
in interfaceWebSocketBase
- Overrides:
writeBinaryMessageAndForget
in classWebSocket
- Returns:
- the instance of WebSocketBase to chain method calls.
-
writeTextMessage
Description copied from interface:WebSocketBase
Same asWebSocketBase.writeTextMessage(java.lang.String)
but with anhandler
called 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:
writeTextMessage
in interfaceWebSocketBase
- Overrides:
writeTextMessage
in classWebSocket
- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
writeTextMessageAndAwait
Description copied from interface:WebSocketBase
Blocking 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:
writeTextMessageAndAwait
in interfaceWebSocketBase
- Overrides:
writeTextMessageAndAwait
in classWebSocket
- Returns:
- the Void instance produced by the operation.
-
writeTextMessageAndForget
Description copied from interface:WebSocketBase
Variant 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:
writeTextMessageAndForget
in interfaceWebSocketBase
- Overrides:
writeTextMessageAndForget
in classWebSocket
- Returns:
- the instance of WebSocketBase to chain method calls.
-
writePing
Description copied from interface:WebSocketBase
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.
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Specified by:
writePing
in interfaceWebSocketBase
- Overrides:
writePing
in classWebSocket
- Parameters:
data
- the data to write, may be at most 125 bytes- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
writePingAndAwait
Description copied from interface:WebSocketBase
Blocking 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:
writePingAndAwait
in interfaceWebSocketBase
- Overrides:
writePingAndAwait
in classWebSocket
- 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:WebSocketBase
Variant 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:
writePingAndForget
in interfaceWebSocketBase
- Overrides:
writePingAndForget
in classWebSocket
- 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:WebSocketBase
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.
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Specified by:
writePong
in interfaceWebSocketBase
- Overrides:
writePong
in classWebSocket
- Parameters:
data
- the data to write, may be at most 125 bytes- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
writePongAndAwait
Description copied from interface:WebSocketBase
Blocking 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:
writePongAndAwait
in interfaceWebSocketBase
- Overrides:
writePongAndAwait
in classWebSocket
- 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:WebSocketBase
Variant 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:
writePongAndForget
in interfaceWebSocketBase
- Overrides:
writePongAndForget
in classWebSocket
- Parameters:
data
- the data to write, may be at most 125 bytes- Returns:
- the instance of WebSocketBase to chain method calls.
-
sslSession
- Specified by:
sslSession
in interfaceWebSocketBase
- Overrides:
sslSession
in classWebSocket
- Returns:
- SSLSession associated with the underlying socket. Returns null if connection is not SSL.
-
toMulti
- Specified by:
toMulti
in interfaceReadStream<Buffer>
- Overrides:
toMulti
in classWebSocket
-
toBlockingIterable
- Overrides:
toBlockingIterable
in classWebSocket
-
toBlockingStream
- Overrides:
toBlockingStream
in classWebSocket
-
newInstance
-