IN
- The type that will be received by this clientOUT
- The type that will be sent by this clientpublic class NettyTcpClient<IN,OUT> extends TcpClient<IN,OUT>
TcpClient
.connectAddress
PING
started
Constructor and Description |
---|
NettyTcpClient(Environment env,
Dispatcher dispatcher,
Supplier<InetSocketAddress> hostSupplier,
ClientSocketOptions options,
SslOptions sslOptions,
Codec<Buffer,IN,OUT> codec)
Creates a new NettyTcpClient that will use the given
env for configuration and the given reactor to
send events. |
Modifier and Type | Method and Description |
---|---|
protected void |
addSecureHandler(io.netty.channel.socket.SocketChannel ch) |
protected void |
bindChannel(ReactorChannelHandler<IN,OUT,ChannelStream<IN,OUT>> handler,
io.netty.channel.socket.SocketChannel nativeChannel) |
protected Promise<Void> |
doShutdown() |
protected Promise<Void> |
doStart(ReactorChannelHandler<IN,OUT,ChannelStream<IN,OUT>> handler) |
protected Stream<Tuple2<InetSocketAddress,Integer>> |
doStart(ReactorChannelHandler<IN,OUT,ChannelStream<IN,OUT>> handler,
Reconnect reconnect) |
getConnectAddress, getOptions, getSslOptions
start
getDefaultCodec, getDefaultDispatcher, getDefaultEnvironment, getDefaultPrefetchSize, shutdown, start
public NettyTcpClient(Environment env, Dispatcher dispatcher, Supplier<InetSocketAddress> hostSupplier, ClientSocketOptions options, SslOptions sslOptions, Codec<Buffer,IN,OUT> codec)
env
for configuration and the given reactor
to
send events. The number of IO threads used by the client is configured by the environment's reactor.tcp.ioThreadCount
property. In its absence the number of IO threads will be equal to the number of available processors
. The client will connect to the given connectAddress
, configuring its socket using the given opts
. The given codec
will be used for
encoding and decoding of data.env
- The configuration environmentdispatcher
- The dispatcher used to send eventshostSupplier
- The address the client will connect tooptions
- The configuration options for the client's socketsslOptions
- The SSL configuration options for the client's socketcodec
- The codec used to encode and decode dataprotected Promise<Void> doStart(ReactorChannelHandler<IN,OUT,ChannelStream<IN,OUT>> handler)
doStart
in class ReactorPeer<IN,OUT,ChannelStream<IN,OUT>>
protected void addSecureHandler(io.netty.channel.socket.SocketChannel ch) throws Exception
Exception
protected Stream<Tuple2<InetSocketAddress,Integer>> doStart(ReactorChannelHandler<IN,OUT,ChannelStream<IN,OUT>> handler, Reconnect reconnect)
doStart
in class ReactorClient<IN,OUT,ChannelStream<IN,OUT>>
protected Promise<Void> doShutdown()
doShutdown
in class ReactorPeer<IN,OUT,ChannelStream<IN,OUT>>
protected void bindChannel(ReactorChannelHandler<IN,OUT,ChannelStream<IN,OUT>> handler, io.netty.channel.socket.SocketChannel nativeChannel)
Copyright © 2016. All rights reserved.