public abstract class ChannelHandlerAdapter extends Object implements ChannelBoundHandler
| 构造器和说明 |
|---|
ChannelHandlerAdapter() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
channelAdded(SocketChannel socketChannel)
连接进来
|
void |
channelClosed(SocketChannel socketChannel)
连接关闭
|
void |
channelRead(SocketChannel socketChannel,
Object obj)
消息读取
|
void |
channelWrite(SocketChannel socketChannel,
Object obj)
消息写出
|
void |
decode(SocketChannel socketChannel,
Object obj,
LinkedNonReadBlockQueue<Object> out)
消息解码
|
void |
encode(SocketChannel socketChannel,
Object obj)
消息编码
|
void |
exceptionCaught(SocketChannel socketChannel,
Throwable cause)
异常
|
void |
userEventTriggered(SocketChannel socketChannel,
IdleState evt)
该方法类似一个心态起搏器,执行读或写操作会被触发
|
public void channelAdded(SocketChannel socketChannel) throws Exception
ChannelBoundHandlerchannelAdded 在接口中 ChannelBoundHandlersocketChannel - 通道Exception - 异常public void channelClosed(SocketChannel socketChannel) throws Exception
ChannelBoundHandlerchannelClosed 在接口中 ChannelBoundHandlersocketChannel - 通道Exception - 异常public void channelRead(SocketChannel socketChannel, Object obj) throws Exception
ChannelBoundHandlerchannelRead 在接口中 ChannelBoundHandlersocketChannel - 通道obj - 读取消息Exception - 异常public void exceptionCaught(SocketChannel socketChannel, Throwable cause) throws Exception
ChannelBoundHandlerexceptionCaught 在接口中 ChannelBoundHandlersocketChannel - 通道cause - 异常信息Exception - 异常public void decode(SocketChannel socketChannel, Object obj, LinkedNonReadBlockQueue<Object> out) throws Exception
ChannelBoundHandlerdecode 在接口中 ChannelBoundHandlersocketChannel - 通道obj - 消息out - 消息队列Exception - 异常public void channelWrite(SocketChannel socketChannel, Object obj) throws Exception
ChannelBoundHandlerchannelWrite 在接口中 ChannelBoundHandlersocketChannel - 通道obj - 数据Exception - 异常public void encode(SocketChannel socketChannel, Object obj) throws Exception
ChannelBoundHandlerencode 在接口中 ChannelBoundHandlersocketChannel - 通道obj - 数据Exception - 异常public void userEventTriggered(SocketChannel socketChannel, IdleState evt) throws Exception
ChannelBoundHandleruserEventTriggered 在接口中 ChannelBoundHandlersocketChannel - 通道evt - IdleStateException - 异常Copyright © 2021. All rights reserved.