public class EventProcess extends Object
Modifier and Type | Method and Description |
---|---|
static Object |
doRecive(IoSession session,
int splitLength)
接收的消息处理函数
|
static Object |
filterDecoder(IoSession session,
ByteBuffer readedBuffer)
使用过滤器过滤解码结果
|
static ByteBuffer |
filterEncoder(IoSession session,
Object result)
使用过滤器编码结果
|
static ByteBuffer |
loadSplitData(IoSession session,
int splitLength)
读取分割方法
|
static void |
onAccepted(Event event)
Accept事件
|
static void |
onConnect(Event event)
连接成功事件 建立连接完成后出发
|
static void |
onDisconnect(Event event)
连接断开事件 断开后出发
|
static void |
onException(Event event,
Exception e)
异常产生事件 异常产生侯触发
|
static void |
onFlush(Event event)
发送到 Socket 缓冲区事件
|
static void |
onIdle(Event event)
空闲事件触发
|
static void |
onRead(Event event)
读取事件 在消息接受完成后触发
|
static void |
onSent(Event event,
Object sendObj)
发送完成事件 发送后出发
|
static void |
process(Event event)
处理异常
|
static void |
sendMessage(IoSession session,
Object obj)
在一个独立的线程中并行的发送消息
|
public static void onAccepted(Event event) throws IOException
event
- 事件对象IOException
- IO 异常public static void onConnect(Event event) throws IOException
event
- 事件对象IOException
- IO 异常public static void onDisconnect(Event event)
event
- 事件对象public static void onRead(Event event) throws IOException
event
- 事件对象IOException
- IO 异常public static ByteBuffer loadSplitData(IoSession session, int splitLength)
session
- 会话对象splitLength
- 分割长度public static Object doRecive(IoSession session, int splitLength) throws IOException
session
- 会话对象splitLength
- 分割有效自己数IoFilterException
- 过滤器异常IOException
public static Object filterDecoder(IoSession session, ByteBuffer readedBuffer) throws IoFilterException
session
- Session 对象readedBuffer
- 需解码的对象IoFilterException
- 过滤器异常public static ByteBuffer filterEncoder(IoSession session, Object result) throws IoFilterException
session
- Session 对象result
- 需编码的对象IoFilterException
- 过滤器异常public static void sendMessage(IoSession session, Object obj)
session
- Session 对象obj
- 待发送的对象public static void onSent(Event event, Object sendObj) throws IOException
event
- 事件对象sendObj
- 发送的对象IOException
- IO 异常public static void onFlush(Event event) throws IOException
event
- 事件对象IOException
- IO 异常public static void onIdle(Event event)
event
- 事件对象public static void onException(Event event, Exception e)
event
- 事件对象e
- 异常对象public static void process(Event event)
event
- 事件对象Copyright © 2020 Voovan. All rights reserved.