类 NettyChannelHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<io.netty.buffer.ByteBuf>
com.cdkjframework.socket.handler.NettyChannelHandler
- 所有已实现的接口:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
@Component
@Sharable
public class NettyChannelHandler
extends io.netty.channel.SimpleChannelInboundHandler<io.netty.buffer.ByteBuf>
-
嵌套类概要
从接口继承的嵌套类/接口 io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidchannelInactive(io.netty.channel.ChannelHandlerContext ctx) 有客户端终止连接服务器会触发此函数voidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) 异常处理voidhandlerAdded(io.netty.channel.ChannelHandlerContext ctx) 连接成功voidhandlerRemoved(io.netty.channel.ChannelHandlerContext ctx) 断开成功从类继承的方法 io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelRead从类继承的方法 io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered从类继承的方法 io.netty.channel.ChannelHandlerAdapter
isSharable
-
构造器详细资料
-
NettyChannelHandler
构造函数- 参数:
socketListener- 监听接口
-
-
方法详细资料
-
handlerAdded
连接成功- 指定者:
handlerAdded在接口中io.netty.channel.ChannelHandler- 覆盖:
handlerAdded在类中io.netty.channel.ChannelHandlerAdapter- 参数:
ctx- 通道处理程序上下文- 抛出:
Exception- 异常信息
-
handlerRemoved
断开成功- 指定者:
handlerRemoved在接口中io.netty.channel.ChannelHandler- 覆盖:
handlerRemoved在类中io.netty.channel.ChannelHandlerAdapter- 参数:
ctx- 通道处理程序上下文- 抛出:
Exception- 异常信息
-
channelInactive
有客户端终止连接服务器会触发此函数- 指定者:
channelInactive在接口中io.netty.channel.ChannelInboundHandler- 覆盖:
channelInactive在类中io.netty.channel.ChannelInboundHandlerAdapter- 参数:
ctx- 通道进程- 抛出:
Exception- 异常信息
-
exceptionCaught
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) throws Exception 异常处理- 指定者:
exceptionCaught在接口中io.netty.channel.ChannelHandler- 指定者:
exceptionCaught在接口中io.netty.channel.ChannelInboundHandler- 覆盖:
exceptionCaught在类中io.netty.channel.ChannelInboundHandlerAdapter- 参数:
ctx- 通道处理程序上下文cause- 异常信息- 抛出:
Exception
-