org.voovan.network.handler.SynchronousHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of voovan-network Show documentation
Show all versions of voovan-network Show documentation
Voovan is a java framwork and it not depends on any third-party framework.
package org.voovan.network.handler;
import org.voovan.network.IoHandler;
import org.voovan.network.IoSession;
/**
* Socket 同步通信 handler
*
* @author helyho
*
* Voovan Framework.
* WebSite: https://github.com/helyho/Voovan
* Licence: Apache v2 License
*/
public class SynchronousHandler implements IoHandler {
@Override
public Object onConnect(IoSession session) {
return null;
}
@Override
public void onDisconnect(IoSession session) {
}
@Override
public Object onReceive(IoSession session, Object obj) {
session.setAttribute("SocketResponse",obj);
return null;
}
@Override
public void onSent(IoSession session, Object obj) {
}
@Override
public void onException(IoSession session, Exception e) {
session.setAttribute("SocketException",e);
}
}