Package | Description |
---|---|
cn.hutool.socket.aio |
AIO相关封装
|
cn.hutool.socket.protocol |
消息协议接口及实现
|
Modifier and Type | Method and Description |
---|---|
AioSession |
AioSession.closeIn()
关闭输出
|
AioSession |
AioSession.closeOut()
关闭输出
|
AioSession |
AioSession.read()
读取数据到Buffer
|
AioSession |
AioSession.read(CompletionHandler<Integer,AioSession> handler)
读取数据到Buffer
|
AioSession |
AioSession.write(ByteBuffer data,
CompletionHandler<Integer,AioSession> handler)
写数据到目标端
|
AioSession |
AioSession.writeAndClose(ByteBuffer data)
写数据到目标端,并关闭输出
|
Modifier and Type | Method and Description |
---|---|
void |
SimpleIoAction.accept(AioSession session) |
void |
IoAction.accept(AioSession session)
接收客户端连接(会话建立)事件处理
|
void |
ReadHandler.completed(Integer result,
AioSession session) |
void |
IoAction.doAction(AioSession session,
T data)
执行数据处理(消息读取)
|
void |
SimpleIoAction.failed(Throwable exc,
AioSession session) |
void |
ReadHandler.failed(Throwable exc,
AioSession session) |
void |
IoAction.failed(Throwable exc,
AioSession session)
数据读取失败的回调事件处理(消息读取失败)
|
Modifier and Type | Method and Description |
---|---|
AioSession |
AioSession.read(CompletionHandler<Integer,AioSession> handler)
读取数据到Buffer
|
AioSession |
AioSession.write(ByteBuffer data,
CompletionHandler<Integer,AioSession> handler)
写数据到目标端
|
Modifier and Type | Method and Description |
---|---|
T |
MsgDecoder.decode(AioSession session,
ByteBuffer readBuffer)
对于从Socket流中获取到的数据采用当前MsgDecoder的实现类协议进行解析。
|
void |
MsgEncoder.encode(AioSession session,
ByteBuffer writeBuffer,
T data)
编码数据用于写出
|
Copyright © 2024. All rights reserved.