类 BaseServerHandler<T>
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.channel.SimpleChannelInboundHandler<T>
-
- xin.alum.aio.handler.BaseServerHandler<T>
-
- 所有已实现的接口:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
- 直接已知子类:
SocksServerHandler,WebSocketServerHandler
public abstract class BaseServerHandler<T> extends io.netty.channel.SimpleChannelInboundHandler<T>- 作者:
- Alum(alum @ live.cn)
-
-
字段概要
字段 修饰符和类型 字段 说明 protected io.netty.util.internal.logging.InternalLoggerlogger
-
构造器概要
构造器 构造器 说明 BaseServerHandler()
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 voidchannelActive(io.netty.channel.ChannelHandlerContext ctx)活跃voidchannelInactive(io.netty.channel.ChannelHandlerContext ctx)protected abstract voidchannelRead0(io.netty.channel.ChannelHandlerContext channelHandlerContext, T t)voidchannelReadComplete(io.netty.channel.ChannelHandlerContext ctx)voidchannelRegistered(io.netty.channel.ChannelHandlerContext ctx)注册voidchannelUnregistered(io.netty.channel.ChannelHandlerContext ctx)voidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)protected AioReceivegetAioReceiver()获取接受对象protected AioConfiggetProperties()获取 aio 配置信息voidhandlerAdded(io.netty.channel.ChannelHandlerContext ctx)添加voidhandlerRemoved(io.netty.channel.ChannelHandlerContext ctx)protected voidheartBeat(io.netty.channel.Channel ch)心跳超时逻辑处理voidonClose(io.netty.channel.Channel ch, AioClose aioClose)关闭连接voiduserEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt)
-
-
-
方法详细资料
-
getProperties
protected AioConfig getProperties()
获取 aio 配置信息- 返回:
-
getAioReceiver
protected AioReceive getAioReceiver()
获取接受对象- 返回:
-
onClose
public void onClose(io.netty.channel.Channel ch, AioClose aioClose)关闭连接- 参数:
ch-aioClose-
-
handlerAdded
public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx) throws Exception添加- 指定者:
handlerAdded在接口中io.netty.channel.ChannelHandler- 覆盖:
handlerAdded在类中io.netty.channel.ChannelHandlerAdapter- 参数:
ctx-- 抛出:
Exception
-
exceptionCaught
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)- 指定者:
exceptionCaught在接口中io.netty.channel.ChannelHandler- 指定者:
exceptionCaught在接口中io.netty.channel.ChannelInboundHandler- 覆盖:
exceptionCaught在类中io.netty.channel.ChannelInboundHandlerAdapter
-
channelRegistered
public void channelRegistered(io.netty.channel.ChannelHandlerContext ctx) throws Exception注册- 指定者:
channelRegistered在接口中io.netty.channel.ChannelInboundHandler- 覆盖:
channelRegistered在类中io.netty.channel.ChannelInboundHandlerAdapter- 参数:
ctx-- 抛出:
Exception
-
channelActive
public void channelActive(io.netty.channel.ChannelHandlerContext ctx) throws Exception活跃- 指定者:
channelActive在接口中io.netty.channel.ChannelInboundHandler- 覆盖:
channelActive在类中io.netty.channel.ChannelInboundHandlerAdapter- 参数:
ctx-- 抛出:
Exception
-
channelInactive
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) throws Exception- 指定者:
channelInactive在接口中io.netty.channel.ChannelInboundHandler- 覆盖:
channelInactive在类中io.netty.channel.ChannelInboundHandlerAdapter- 抛出:
Exception
-
channelRead0
protected abstract void channelRead0(io.netty.channel.ChannelHandlerContext channelHandlerContext, T t) throws Exception
-
channelReadComplete
public void channelReadComplete(io.netty.channel.ChannelHandlerContext ctx) throws Exception- 指定者:
channelReadComplete在接口中io.netty.channel.ChannelInboundHandler- 覆盖:
channelReadComplete在类中io.netty.channel.ChannelInboundHandlerAdapter- 抛出:
Exception
-
channelUnregistered
public void channelUnregistered(io.netty.channel.ChannelHandlerContext ctx) throws Exception- 指定者:
channelUnregistered在接口中io.netty.channel.ChannelInboundHandler- 覆盖:
channelUnregistered在类中io.netty.channel.ChannelInboundHandlerAdapter- 抛出:
Exception
-
handlerRemoved
public void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx) throws Exception- 指定者:
handlerRemoved在接口中io.netty.channel.ChannelHandler- 覆盖:
handlerRemoved在类中io.netty.channel.ChannelHandlerAdapter- 抛出:
Exception
-
userEventTriggered
public void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt)- 指定者:
userEventTriggered在接口中io.netty.channel.ChannelInboundHandler- 覆盖:
userEventTriggered在类中io.netty.channel.ChannelInboundHandlerAdapter
-
heartBeat
protected void heartBeat(io.netty.channel.Channel ch)
心跳超时逻辑处理- 参数:
ch-
-
-