IN - The type that will be received by this clientOUT - The type that will be sent by this clientpublic abstract class TcpClient<IN,OUT> extends AbstractNetPeer<IN,OUT> implements NetClient<IN,OUT>
| Modifier | Constructor and Description |
|---|---|
protected |
TcpClient(reactor.core.Environment env,
reactor.core.Reactor reactor,
java.net.InetSocketAddress connectAddress,
ClientSocketOptions options,
SslOptions sslOptions,
reactor.io.encoding.Codec<reactor.io.Buffer,IN,OUT> codec,
java.util.Collection<reactor.function.Consumer<NetChannel<IN,OUT>>> consumers) |
| Modifier and Type | Method and Description |
|---|---|
java.net.InetSocketAddress |
getConnectAddress()
Get the
InetSocketAddress to which this client must connect. |
protected ClientSocketOptions |
getOptions()
Get the
ClientSocketOptions currently in effect. |
protected SslOptions |
getSslOptions()
Get the
SslOptions current in effect. |
abstract reactor.core.composable.Promise<NetChannel<IN,OUT>> |
open()
Open a
NetChannel to the configured host:port and return a Promise that
will be fulfilled when the client is connected. |
abstract reactor.core.composable.Stream<NetChannel<IN,OUT>> |
open(Reconnect reconnect)
Open a
NetChannel to the configured host:port and return a Stream that will be passed a new NetChannel object every time the client is connected to the endpoint. |
close, close, close, createChannel, doClose, doCloseChannel, getChannels, getCodec, getConsumers, getEnvironment, getReactor, iterator, notifyClose, notifyError, notifyOpen, notifyShutdown, notifyStart, register, selectprotected TcpClient(@Nonnull
reactor.core.Environment env,
@Nonnull
reactor.core.Reactor reactor,
@Nullable
java.net.InetSocketAddress connectAddress,
@Nullable
ClientSocketOptions options,
@Nullable
SslOptions sslOptions,
@Nullable
reactor.io.encoding.Codec<reactor.io.Buffer,IN,OUT> codec,
@Nonnull
java.util.Collection<reactor.function.Consumer<NetChannel<IN,OUT>>> consumers)
public abstract reactor.core.composable.Promise<NetChannel<IN,OUT>> open()
NetChannel to the configured host:port and return a Promise that
will be fulfilled when the client is connected.open in interface NetClient<IN,OUT>Promise that will be filled with the NetChannel when connected.public abstract reactor.core.composable.Stream<NetChannel<IN,OUT>> open(Reconnect reconnect)
NetChannel to the configured host:port and return a Stream that will be passed a new NetChannel object every time the client is connected to the endpoint. The given Reconnect
describes how the client should attempt to reconnect to the host if the initial connection fails or if the client
successfully connects but at some point in the future gets cut off from the host. The Reconnect tells the
client where to try reconnecting and gives a delay describing how long to wait to attempt to reconnect. When the
connect is successfully made, the Stream is sent a new NetChannel backed by the newly-connected
connection.public java.net.InetSocketAddress getConnectAddress()
InetSocketAddress to which this client must connect.protected ClientSocketOptions getOptions()
ClientSocketOptions currently in effect.protected SslOptions getSslOptions()
SslOptions current in effect.