All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.voovan.network.handler.SynchronousHandler Maven / Gradle / Ivy

There is a newer version: 4.3.8
Show newest version
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy