public class ZeroMQTcpClient<IN,OUT> extends TcpClient<IN,OUT>
| Constructor and Description |
|---|
ZeroMQTcpClient(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 |
|---|---|
void |
close(reactor.function.Consumer<java.lang.Boolean> onClose)
Close this client and the underlying channel and invoke the given
Consumer when the
operation has completed. |
protected <C> NetChannel<IN,OUT> |
createChannel(C ioChannel)
Subclasses should implement this method and provide a
NetChannel object. |
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. |
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. |
getConnectAddress, getOptions, getSslOptionsclose, close, doClose, doCloseChannel, getChannels, getCodec, getConsumers, getEnvironment, getReactor, iterator, notifyClose, notifyError, notifyOpen, notifyShutdown, notifyStart, register, selectpublic ZeroMQTcpClient(@Nonnull
reactor.core.Environment env,
@Nonnull
reactor.core.Reactor reactor,
@Nonnull
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 reactor.core.composable.Promise<NetChannel<IN,OUT>> open()
TcpClientNetChannel to the configured host:port and return a Promise that
will be fulfilled when the client is connected.public reactor.core.composable.Stream<NetChannel<IN,OUT>> open(Reconnect reconnect)
TcpClientNetChannel 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 void close(@Nullable
reactor.function.Consumer<java.lang.Boolean> onClose)
NetClientConsumer when the
operation has completed.protected <C> NetChannel<IN,OUT> createChannel(C ioChannel)
AbstractNetPeerNetChannel object.createChannel in class AbstractNetPeer<IN,OUT>C - The type of the channel object.ioChannel - The IO channel object to associate with this NetChannel.NetChannel object.