public final class TcpClient
extends java.lang.Object
Constructor and Description |
---|
TcpClient()
New instance with default configuration.
|
TcpClient(TcpClientConfig config)
New instance.
|
Modifier and Type | Method and Description |
---|---|
ReadOnlyTcpClientConfig |
config()
Returns configuration for this client.
|
Single<NettyConnection<Buffer,Buffer>> |
connect(ExecutionContext executionContext,
java.net.SocketAddress address)
Connect to the passed
address . |
NettyConnection<Buffer,Buffer> |
connectBlocking(ExecutionContext executionContext,
java.net.SocketAddress address)
Connect and await for the connection.
|
NettyConnection<Buffer,Buffer> |
connectWithFdBlocking(ExecutionContext executionContext,
java.net.SocketAddress address)
Connect using a
FileDescriptorSocketAddress and await for the connection. |
public TcpClient()
public TcpClient(TcpClientConfig config)
config
- for the client.public NettyConnection<Buffer,Buffer> connectBlocking(ExecutionContext executionContext, java.net.SocketAddress address) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
executionContext
- ExecutionContext
to use for the connections.address
- to connect.NettyConnection
.java.util.concurrent.ExecutionException
- If connect failed.java.lang.InterruptedException
- If interrupted while waiting for connect to complete.public Single<NettyConnection<Buffer,Buffer>> connect(ExecutionContext executionContext, java.net.SocketAddress address)
address
.executionContext
- ExecutionContext
to use for the connections.address
- to connect.NettyConnection
.public NettyConnection<Buffer,Buffer> connectWithFdBlocking(ExecutionContext executionContext, java.net.SocketAddress address) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
FileDescriptorSocketAddress
and await for the connection.executionContext
- ExecutionContext
to use for the connections.address
- to connect.NettyConnection
.java.util.concurrent.ExecutionException
- If connect failed.java.lang.InterruptedException
- If interrupted while waiting for connect to complete.public ReadOnlyTcpClientConfig config()
ReadOnlyTcpClientConfig
for this client.