public abstract class BaseServerHandler<T>
extends io.netty.channel.SimpleChannelInboundHandler<T>
| 限定符和类型 | 字段和说明 |
|---|---|
protected io.netty.util.internal.logging.InternalLogger |
logger |
| 构造器和说明 |
|---|
BaseServerHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
channelActive(io.netty.channel.ChannelHandlerContext ctx)
活跃
|
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx) |
protected abstract void |
channelRead0(io.netty.channel.ChannelHandlerContext channelHandlerContext,
T t) |
void |
channelReadComplete(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelRegistered(io.netty.channel.ChannelHandlerContext ctx)
注册
|
void |
channelUnregistered(io.netty.channel.ChannelHandlerContext ctx) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
void |
handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
添加
|
void |
handlerRemoved(io.netty.channel.ChannelHandlerContext ctx) |
protected void |
heartBeat(io.netty.channel.Channel ch)
心跳超时逻辑处理
|
protected void |
onClose(io.netty.channel.Channel ch,
ChannelClose channelClose)
关闭连接
|
io.netty.channel.ChannelFuture |
send(io.netty.channel.Channel ch,
Object msg)
向客户端发送消息
|
void |
userEventTriggered(io.netty.channel.ChannelHandlerContext ctx,
Object evt) |
protected void onClose(io.netty.channel.Channel ch,
ChannelClose channelClose)
ch - channelClose - public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
handlerAdded 在接口中 io.netty.channel.ChannelHandlerhandlerAdded 在类中 io.netty.channel.ChannelHandlerAdapterctx - Exceptionpublic void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
exceptionCaught 在接口中 io.netty.channel.ChannelHandlerexceptionCaught 在接口中 io.netty.channel.ChannelInboundHandlerexceptionCaught 在类中 io.netty.channel.ChannelInboundHandlerAdapterpublic void channelRegistered(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelRegistered 在接口中 io.netty.channel.ChannelInboundHandlerchannelRegistered 在类中 io.netty.channel.ChannelInboundHandlerAdapterctx - Exceptionpublic void channelActive(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelActive 在接口中 io.netty.channel.ChannelInboundHandlerchannelActive 在类中 io.netty.channel.ChannelInboundHandlerAdapterctx - Exceptionpublic void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelInactive 在接口中 io.netty.channel.ChannelInboundHandlerchannelInactive 在类中 io.netty.channel.ChannelInboundHandlerAdapterExceptionprotected abstract void channelRead0(io.netty.channel.ChannelHandlerContext channelHandlerContext,
T t)
throws Exception
public void channelReadComplete(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelReadComplete 在接口中 io.netty.channel.ChannelInboundHandlerchannelReadComplete 在类中 io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic void channelUnregistered(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelUnregistered 在接口中 io.netty.channel.ChannelInboundHandlerchannelUnregistered 在类中 io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
handlerRemoved 在接口中 io.netty.channel.ChannelHandlerhandlerRemoved 在类中 io.netty.channel.ChannelHandlerAdapterExceptionpublic void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx,
Object evt)
userEventTriggered 在接口中 io.netty.channel.ChannelInboundHandleruserEventTriggered 在类中 io.netty.channel.ChannelInboundHandlerAdapterpublic io.netty.channel.ChannelFuture send(io.netty.channel.Channel ch,
Object msg)
ch - msg - protected void heartBeat(io.netty.channel.Channel ch)
ch - Copyright © 2020–2022 The AIM Project. All rights reserved.