Class NetClient
- java.lang.Object
-
- io.vertx.mutiny.core.net.NetClient
-
- All Implemented Interfaces:
Measured
public class NetClient extends Object implements Measured
A TCP client.Multiple connections to different servers can be made using the same instance.
This client supports a configurable number of connection attempts and a configurable delay between attempts.
NOTE: This class has been automatically generated from theoriginalnon Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<NetClient>__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description NetClient(io.vertx.core.net.NetClient delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()io.smallrye.mutiny.Uni<NetSocket>connect(int port, String host)Open a connection to a server at the specificportandhost.io.smallrye.mutiny.Uni<NetSocket>connect(int port, String host, String serverName)Open a connection to a server at the specificportandhost.io.smallrye.mutiny.Uni<NetSocket>connect(SocketAddress remoteAddress)Open a connection to a server at the specificremoteAddress.io.smallrye.mutiny.Uni<NetSocket>connect(SocketAddress remoteAddress, String serverName)Open a connection to a server at the specificremoteAddress.NetSocketconnectAndAwait(int port, String host)Blocking variant ofconnect(int,String).NetSocketconnectAndAwait(int port, String host, String serverName)Blocking variant ofconnect(int,String,String).NetSocketconnectAndAwait(SocketAddress remoteAddress)Blocking variant ofconnect(io.vertx.mutiny.core.net.SocketAddress).NetSocketconnectAndAwait(SocketAddress remoteAddress, String serverName)Blocking variant ofconnect(io.vertx.mutiny.core.net.SocketAddress,String).booleanequals(Object o)io.vertx.core.net.NetClientgetDelegate()inthashCode()booleanisMetricsEnabled()static NetClientnewInstance(io.vertx.core.net.NetClient arg)StringtoString()
-
-
-
Method Detail
-
getDelegate
public io.vertx.core.net.NetClient getDelegate()
- Specified by:
getDelegatein interfaceMeasured
-
isMetricsEnabled
public boolean isMetricsEnabled()
- Specified by:
isMetricsEnabledin interfaceMeasured- Returns:
trueif metrics are enabled
-
connect
public io.smallrye.mutiny.Uni<NetSocket> connect(int port, String host)
Open a connection to a server at the specificportandhost.hostcan be a valid host name or IP address. The connect is done asynchronously and on success, aNetSocketinstance is supplied via theconnectHandlerinstanceUnlike 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 host- Returns:
- a reference to this, so the API can be used fluently
-
connectAndAwait
public NetSocket connectAndAwait(int port, String host)
Blocking variant ofconnect(int,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 host- Returns:
- a reference to this, so the API can be used fluently
-
connect
public io.smallrye.mutiny.Uni<NetSocket> connect(int port, String host, String serverName)
Open a connection to a server at the specificportandhost.hostcan be a valid host name or IP address. The connect is done asynchronously and on success, aNetSocketinstance is supplied via theconnectHandlerinstanceUnlike 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 hostserverName- the SNI server name- Returns:
- a reference to this, so the API can be used fluently
-
connectAndAwait
public NetSocket connectAndAwait(int port, String host, String serverName)
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 hostserverName- the SNI server name- Returns:
- a reference to this, so the API can be used fluently
-
connect
public io.smallrye.mutiny.Uni<NetSocket> connect(SocketAddress remoteAddress)
Open a connection to a server at the specificremoteAddress.The connect is done asynchronously and on success, a
NetSocketinstance is supplied via theconnectHandlerinstanceUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
remoteAddress- the remote address- Returns:
- a reference to this, so the API can be used fluently
-
connectAndAwait
public NetSocket connectAndAwait(SocketAddress remoteAddress)
Blocking variant ofconnect(io.vertx.mutiny.core.net.SocketAddress).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:
remoteAddress- the remote address- Returns:
- a reference to this, so the API can be used fluently
-
connect
public io.smallrye.mutiny.Uni<NetSocket> connect(SocketAddress remoteAddress, String serverName)
Open a connection to a server at the specificremoteAddress.The connect is done asynchronously and on success, a
NetSocketinstance is supplied via theconnectHandlerinstanceUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
remoteAddress- the remote addressserverName- the SNI server name- Returns:
- a reference to this, so the API can be used fluently
-
connectAndAwait
public NetSocket connectAndAwait(SocketAddress remoteAddress, String serverName)
Blocking variant ofconnect(io.vertx.mutiny.core.net.SocketAddress,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:
remoteAddress- the remote addressserverName- the SNI server name- Returns:
- a reference to this, so the API can be used fluently
-
close
public void close()
-
newInstance
public static NetClient newInstance(io.vertx.core.net.NetClient arg)
-
-