use of com.generallycloud.baseio.balance.BalanceFuture in project baseio by generallycloud.
the class BalanceFacadeAcceptorHandler method accept.
@Override
public void accept(SocketSession session, Future future) throws Exception {
BalanceFacadeSocketSession fs = (BalanceFacadeSocketSession) session;
BalanceFuture f = (BalanceFuture) future;
if (facadeInterceptor.intercept(fs, f)) {
logger.info("msg intercepted [ {} ], msg: {}", fs.getRemoteSocketAddress(), f);
return;
}
BalanceReverseSocketSession rs = balanceRouter.getRouterSession(fs, f);
if (rs == null || rs.isClosed()) {
noneLoadReadFutureAcceptor.accept(fs, f, balanceReverseLogger);
return;
}
doAccept(fs, rs, f);
}
use of com.generallycloud.baseio.balance.BalanceFuture in project baseio by generallycloud.
the class BalanceReverseAcceptorHandler method accept.
@Override
public void accept(SocketSession session, Future future) throws Exception {
BalanceFuture f = (BalanceFuture) future;
if (f.isBroadcast()) {
balanceFacadeAcceptor.getAcceptor().broadcast(f.translate());
balanceReverseLogger.logBroadcast(session, future, logger);
return;
}
SocketSession response = balanceRouter.getClientSession(f.getSessionKey());
if (response == null || response.isClosed()) {
balanceReverseLogger.logPushLost(session, future, logger);
return;
}
response.flush(f.translate());
balanceReverseLogger.logPush(session, response, future, logger);
}
Aggregations