public abstract class IoAdaptor extends Object
| Constructor and Description |
|---|
IoAdaptor() |
| Modifier and Type | Method and Description |
|---|---|
abstract Object |
decode(IoBuffer buff)
从网络字节码中解码消息对象
|
abstract IoBuffer |
encode(Object msg)
消息对象到网络字节码编码
|
void |
onException(Throwable e,
Session sess)
Session各类错误发生时回调
|
void |
onMessage(Object msg,
Session sess)
Session接受到消息对象
|
void |
onSessionAccepted(Session sess)
服务器端侦听到链接接入回调,此时Session尚未注册,默认注册该Session
|
void |
onSessionConnected(Session sess)
客户端链接成功后回调
|
void |
onSessionDestroyed(Session sess)
Session注销前回调
|
void |
onSessionRegistered(Session sess)
Session注册到Dispatcher成功后回调
|
public void onSessionAccepted(Session sess) throws IOException
sess - IOExceptionpublic void onSessionRegistered(Session sess) throws IOException
sess - IOExceptionpublic void onSessionConnected(Session sess) throws IOException
sess - IOExceptionpublic void onSessionDestroyed(Session sess) throws IOException
sess - IOExceptionpublic void onMessage(Object msg, Session sess) throws IOException
msg - sess - IOExceptionpublic void onException(Throwable e, Session sess) throws IOException
e - sess - IOExceptionCopyright © 2015. All rights reserved.