Constructor and Description |
---|
SynchronousHandler() |
Modifier and Type | Method and Description |
---|---|
void |
addResponse(Object obj)
增加响应对象
|
void |
clearResponse() |
void |
dataNotify() |
Object |
getResponse(int timeout)
获取下一个响应对象
|
boolean |
hasNextResponse()
是否存在下一个响应对象
|
Object |
onConnect(IoSession session)
连接成功事件
|
void |
onDisconnect(IoSession session)
连接断开事件
|
void |
onException(IoSession session,
Exception e)
异常事件
|
void |
onFlush(IoSession session)
Socket 缓冲区发送事件
|
void |
onIdle(IoSession session)
空闲事件
|
Object |
onReceive(IoSession session,
Object obj)
接收数据事件
|
void |
onSent(IoSession session,
Object obj)
发送数据事件
发送后调用
|
int |
responseCount()
获取响应对象数量
|
void |
waitData(int timeout) |
public Object onConnect(IoSession session)
IoHandler
public void onDisconnect(IoSession session)
IoHandler
onDisconnect
in interface IoHandler
session
- Session 对象public Object onReceive(IoSession session, Object obj)
IoHandler
public void onSent(IoSession session, Object obj)
IoHandler
public void onFlush(IoSession session)
IoHandler
public void onException(IoSession session, Exception e)
IoHandler
onException
in interface IoHandler
session
- Session 对象e
- 异常信息public void addResponse(Object obj)
obj
- 响应对象public Object getResponse(int timeout) throws Exception
timeout
- 超时时间TimeoutException
- 超时异常Exception
public int responseCount()
public void clearResponse()
public boolean hasNextResponse()
public void waitData(int timeout) throws TimeoutException
TimeoutException
public void dataNotify()
Copyright © 2020 Voovan. All rights reserved.