public class NettyClientConfig extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected io.netty.bootstrap.Bootstrap |
booter |
protected Class<? extends io.netty.channel.socket.SocketChannel> |
channelClass |
protected long |
connectTimeOutMills
连接超时毫秒
|
protected io.netty.channel.EventLoopGroup |
ioWorkers |
protected io.netty.handler.logging.LogLevel |
level
设置日志记录的级别
当日志级别不为空时,则设置日志记录器
|
| 构造器和说明 |
|---|
NettyClientConfig() |
NettyClientConfig(Class<? extends io.netty.channel.socket.SocketChannel> channelClass,
io.netty.channel.EventLoopGroup ioWorkers) |
NettyClientConfig(int ioThreads) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
destory() |
protected io.netty.channel.ChannelFuture |
doBooterConnect(InetSocketAddress address,
io.netty.channel.ChannelHandler init)
因为每次连接执行都会init都会被remove,所以每次调用booter都会用新的handler来进行连接配置
|
Class<? extends io.netty.channel.socket.SocketChannel> |
getChannelClass() |
long |
getConnectTimeOutMills() |
io.netty.channel.EventLoopGroup |
getIoWorkers() |
io.netty.handler.logging.LogLevel |
getLevel() |
protected void |
initBooterOptions(OptionConfiger configer)
初始化客户端配置
|
protected io.netty.channel.ChannelHandler |
initHandlerAdapter(io.netty.channel.ChannelHandler init)
初始化handler适配包装
|
OptionConfiger |
optionConfig() |
void |
setConnectTimeOutMills(long connectTimeOutMills) |
void |
setLevel(io.netty.handler.logging.LogLevel level) |
protected final Class<? extends io.netty.channel.socket.SocketChannel> channelClass
protected final io.netty.channel.EventLoopGroup ioWorkers
protected io.netty.handler.logging.LogLevel level
protected long connectTimeOutMills
protected final io.netty.bootstrap.Bootstrap booter
public NettyClientConfig(Class<? extends io.netty.channel.socket.SocketChannel> channelClass, io.netty.channel.EventLoopGroup ioWorkers)
public NettyClientConfig()
public NettyClientConfig(int ioThreads)
public Class<? extends io.netty.channel.socket.SocketChannel> getChannelClass()
public io.netty.channel.EventLoopGroup getIoWorkers()
public io.netty.handler.logging.LogLevel getLevel()
public void setLevel(io.netty.handler.logging.LogLevel level)
public long getConnectTimeOutMills()
public void setConnectTimeOutMills(long connectTimeOutMills)
public void destory()
protected void initBooterOptions(OptionConfiger configer)
public OptionConfiger optionConfig()
protected io.netty.channel.ChannelHandler initHandlerAdapter(io.netty.channel.ChannelHandler init)
init - protected io.netty.channel.ChannelFuture doBooterConnect(InetSocketAddress address, io.netty.channel.ChannelHandler init)
address - init - Copyright © 2020. All rights reserved.