public class NettyClient extends AbstractNettyClient
| 限定符和类型 | 字段和说明 |
|---|---|
protected NettyClientConfig |
config |
protected io.netty.channel.ChannelHandler |
handler
业务处理handler
|
reconect, reconectListener, target, timeMills| 构造器和说明 |
|---|
NettyClient(NettyClientConfig config,
InetSocketAddress target,
io.netty.channel.ChannelHandler handler) |
NettyClient(NettyClientConfig config,
InetSocketAddress target,
WebSocketClientAdapterHandler handler) |
NettyClient(NettyClientConfig config,
String host,
int port,
io.netty.channel.ChannelHandler handler) |
NettyClient(String host,
int port,
io.netty.channel.ChannelHandler handler) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected io.netty.channel.ChannelFuture |
doBooterConnect(InetSocketAddress target,
io.netty.channel.ChannelHandler fixedHandler) |
protected io.netty.channel.ChannelFuture |
doConnect(InetSocketAddress target)
对handler进行调整后调用启动器发起连接
|
protected io.netty.channel.ChannelHandler |
fixHandlerBeforeConnect(io.netty.channel.ChannelHandler handler)
执行连接前是否修正handler
|
protected io.netty.bootstrap.Bootstrap |
getBooter()
获取客户端使用的起动器
|
protected io.netty.channel.EventLoopGroup |
getIoWorkers()
获取客户端使用的IO线程池
|
connect, disableReconnect, doReconect, enableReconnect, flush, getChannel, getName, getReconnectExecutor, getReconnectTimeMills, getTarget, isConnected, isReconnect, sendData, sendObject, setChannel, setName, start, stopprotected final NettyClientConfig config
protected final io.netty.channel.ChannelHandler handler
public NettyClient(String host, int port, io.netty.channel.ChannelHandler handler)
public NettyClient(NettyClientConfig config, String host, int port, io.netty.channel.ChannelHandler handler)
public NettyClient(NettyClientConfig config, InetSocketAddress target, io.netty.channel.ChannelHandler handler)
public NettyClient(NettyClientConfig config, InetSocketAddress target, WebSocketClientAdapterHandler handler)
protected final io.netty.bootstrap.Bootstrap getBooter()
AbstractNettyClientgetBooter 在类中 AbstractNettyClientprotected final io.netty.channel.EventLoopGroup getIoWorkers()
AbstractNettyClientgetIoWorkers 在类中 AbstractNettyClientprotected final io.netty.channel.ChannelFuture doConnect(InetSocketAddress target)
doConnect 在类中 AbstractNettyClienttarget - protected io.netty.channel.ChannelHandler fixHandlerBeforeConnect(io.netty.channel.ChannelHandler handler)
handler - 业务handlerprotected io.netty.channel.ChannelFuture doBooterConnect(InetSocketAddress target, io.netty.channel.ChannelHandler fixedHandler)
target - 连接目标fixedHandler - 修正后的handlerCopyright © 2020. All rights reserved.