public class AioReceiver extends Object implements AioReceive
| 限定符和类型 | 字段和说明 |
|---|---|
protected SessionGroups |
groups
所有群组
|
protected io.netty.util.internal.logging.InternalLogger |
logger
日志对象
|
protected Sessions |
sessions
所有会话
|
| 构造器和说明 |
|---|
AioReceiver() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
onByte(io.netty.channel.Channel ch,
io.netty.buffer.ByteBuf in)
处理WebSocket binary请求
测试方法,正式业务请重写
|
void |
onClose(io.netty.channel.Channel ch,
AioClose close)
关闭连接通道
|
boolean |
onHandShake(io.netty.channel.Channel ch,
io.netty.buffer.ByteBuf in)
Socks基于自定义Bing握手处理逻辑,绑定用户信息到会话系统
|
boolean |
onHandShake(io.netty.channel.Channel ch,
io.netty.handler.codec.http.FullHttpRequest req,
io.netty.handler.codec.http.FullHttpResponse res)
WebSocket握手处理逻辑,绑定用户信息到会话系统
|
boolean |
onHandShake(io.netty.channel.Channel ch,
String token)
Socks基于ProtoBuf-Login的握手处理逻辑
|
void |
onHandShaked(io.netty.channel.Channel ch)
握手成功业务处理类,此方法支持Async异步处理
|
Events |
onKick(io.netty.channel.Channel old,
Session session)
处理互踢旧连接关闭业务逻辑
|
void |
onPing(io.netty.channel.Channel ch)
收到客户端的Ping操作
|
void |
onRecive(io.netty.channel.Channel ch,
Events s)
测试方法,正式业务请重写
|
void |
onText(io.netty.channel.Channel ch,
String text)
Text类型数据处理,测试用,正式业务请重写
|
protected final io.netty.util.internal.logging.InternalLogger logger
@Autowired protected Sessions sessions
@Autowired protected SessionGroups groups
public boolean onHandShake(io.netty.channel.Channel ch,
io.netty.handler.codec.http.FullHttpRequest req,
io.netty.handler.codec.http.FullHttpResponse res)
onHandShake 在接口中 WebSocketHandShakech - 当前连接通道req - 当前上行请求,URL参数已经放入ch中res - 握手失败 return false 输出给客户端的对象public boolean onHandShake(io.netty.channel.Channel ch,
io.netty.buffer.ByteBuf in)
onHandShake 在接口中 SocksHandShakech - 通道in - 握手数据包public boolean onHandShake(io.netty.channel.Channel ch,
String token)
onHandShake 在接口中 SocksHandShakech - token - public void onHandShaked(io.netty.channel.Channel ch)
AioReceiveonHandShaked 在接口中 AioReceivepublic void onPing(io.netty.channel.Channel ch)
AioReceiveonPing 在接口中 AioReceivepublic void onText(io.netty.channel.Channel ch,
String text)
onText 在接口中 AioReceivech - text - public void onByte(io.netty.channel.Channel ch,
io.netty.buffer.ByteBuf in)
onByte 在接口中 AioReceivech - in - com.google.protobuf.InvalidProtocolBufferExceptionpublic void onRecive(io.netty.channel.Channel ch,
Events s)
onRecive 在接口中 AioReceivech - s - public Events onKick(io.netty.channel.Channel old, Session session)
AioReceiveonKick 在接口中 AioReceivepublic void onClose(io.netty.channel.Channel ch,
AioClose close)
AioReceiveonClose 在接口中 AioReceiveCopyright © 2020–2023 The Aio Project. All rights reserved.