public final class TcpConnector
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <C extends ListenableAsyncCloseable> |
connect(java.net.SocketAddress localAddress,
java.lang.Object resolvedRemoteAddress,
ReadOnlyTcpClientConfig config,
boolean autoRead,
ExecutionContext executionContext,
java.util.function.Function<io.netty.channel.Channel,Single<? extends C>> connectionFactory)
Connects to the passed
resolvedRemoteAddress address, resolving the address, if required. |
public static <C extends ListenableAsyncCloseable> Single<C> connect(@Nullable java.net.SocketAddress localAddress, java.lang.Object resolvedRemoteAddress, ReadOnlyTcpClientConfig config, boolean autoRead, ExecutionContext executionContext, java.util.function.Function<io.netty.channel.Channel,Single<? extends C>> connectionFactory)
resolvedRemoteAddress
address, resolving the address, if required.C
- Type of the created connection.localAddress
- The local address to bind to, or null
.resolvedRemoteAddress
- The address to connect to. This address should already be resolved at this point.config
- The ReadOnlyTcpClientConfig
to use while connecting.autoRead
- if true
auto read will be enabled for new Channel
s.executionContext
- The ExecutionContext
to use for the returned NettyConnection
.connectionFactory
- Function
to create a NettyConnection
asynchronously.Single
that completes with a new Channel
when connected.