Search in sources :

Example 1 with BalanceRouter

use of com.generallycloud.baseio.balance.router.BalanceRouter in project baseio by generallycloud.

the class BalanceFacadeAcceptorSEListener method sessionClosed.

@Override
public void sessionClosed(SocketSession session) {
    BalanceFacadeSocketSession fs = (BalanceFacadeSocketSession) session;
    balanceRouter.removeClientSession(fs);
    logger.info("client from [ {} ] disconnected.", session.getRemoteSocketAddress());
    BalanceRouter balanceRouter = balanceContext.getBalanceRouter();
    BalanceReverseSocketSession rs = balanceRouter.getRouterSession(fs);
    if (rs == null) {
        return;
    }
    ChannelLostFutureFactory factory = balanceContext.getChannelLostReadFutureFactory();
    if (factory == null) {
        return;
    }
    rs.flush(factory.createChannelLostPacket(fs));
}
Also used : BalanceReverseSocketSession(com.generallycloud.baseio.balance.reverse.BalanceReverseSocketSession) ChannelLostFutureFactory(com.generallycloud.baseio.balance.ChannelLostFutureFactory) BalanceRouter(com.generallycloud.baseio.balance.router.BalanceRouter)

Aggregations

ChannelLostFutureFactory (com.generallycloud.baseio.balance.ChannelLostFutureFactory)1 BalanceReverseSocketSession (com.generallycloud.baseio.balance.reverse.BalanceReverseSocketSession)1 BalanceRouter (com.generallycloud.baseio.balance.router.BalanceRouter)1