@ChannelHandler.Sharable public class DynamicProtocolChannelHandler extends AbstractChannelHandler<io.netty.buffer.ByteBuf,Object>
| 限定符和类型 | 字段和说明 |
|---|---|
static io.netty.util.AttributeKey<TcpChannel> |
ATTR_KEY_TCP_CHANNEL |
| 构造器和说明 |
|---|
DynamicProtocolChannelHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addTcpChannel(io.netty.channel.ChannelId id,
TcpChannel tcpChannel) |
void |
channelActive(io.netty.channel.ChannelHandlerContext ctx) |
void |
enableTcpPackageLog(io.netty.handler.logging.LogLevel logLevel) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
long |
getFirstClientPacketReadTimeoutMs() |
int |
getMaxConnections() |
ProtocolHandler |
getProtocolHandler(io.netty.buffer.ByteBuf msg) |
ProtocolHandler |
getProtocolHandler(io.netty.channel.Channel channel) |
TcpChannel |
getTcpChannel(io.netty.channel.ChannelId id) |
int |
getTcpChannelCount() |
void |
removeTcpChannel(io.netty.channel.ChannelId id) |
void |
setFirstClientPacketReadTimeoutMs(long firstClientPacketReadTimeoutMs) |
void |
setMaxConnections(int maxConnections) |
void |
setProtocolHandlers(Collection<ProtocolHandler> protocolHandlers) |
channelRead, messageToString, userEventTriggered, writebind, close, connect, deregister, disconnect, flush, readpublic static final io.netty.util.AttributeKey<TcpChannel> ATTR_KEY_TCP_CHANNEL
public void channelActive(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelActive 在接口中 io.netty.channel.ChannelInboundHandlerchannelActive 在类中 io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic ProtocolHandler getProtocolHandler(io.netty.buffer.ByteBuf msg)
public ProtocolHandler getProtocolHandler(io.netty.channel.Channel channel)
public TcpChannel getTcpChannel(io.netty.channel.ChannelId id)
public void addTcpChannel(io.netty.channel.ChannelId id,
TcpChannel tcpChannel)
public void removeTcpChannel(io.netty.channel.ChannelId id)
public int getTcpChannelCount()
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
throws Exception
exceptionCaught 在接口中 io.netty.channel.ChannelHandlerexceptionCaught 在接口中 io.netty.channel.ChannelInboundHandlerexceptionCaught 在类中 io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic void setMaxConnections(int maxConnections)
public int getMaxConnections()
public void setProtocolHandlers(Collection<ProtocolHandler> protocolHandlers)
public long getFirstClientPacketReadTimeoutMs()
public void setFirstClientPacketReadTimeoutMs(long firstClientPacketReadTimeoutMs)
public void enableTcpPackageLog(io.netty.handler.logging.LogLevel logLevel)
Copyright © 2021. All rights reserved.