use of org.mobicents.tools.smpp.balancer.impl.BinderRunnable in project load-balancer by RestComm.
the class BalancerDispatcher method bindRequested.
@Override
public void bindRequested(Long sessionId, ServerConnectionImpl serverConnection, Pdu packet) {
// InvocationContext invocationContext = balancerRunner.getLatestInvocationContext();
balancerRunner.balancerContext.smppRequestsToServer.getAndIncrement();
balancerRunner.incMessages();
balancerRunner.balancerContext.smppRequestsProcessedById.get(packet.getCommandId()).incrementAndGet();
balancerRunner.balancerContext.smppBytesToServer.addAndGet(packet.getCommandLength());
serverSessions.put(sessionId, serverConnection);
SmppSessionConfiguration sessionConfig = serverConnection.getConfig();
if (!serverConnection.getConfig().isUseSsl())
sessionConfig.setUseSsl(false);
else
sessionConfig.setUseSsl(!balancerRunner.balancerContext.terminateTLSTraffic);
counterConnections.compareAndSet(Integer.MAX_VALUE, 0);
Node currNode = ctx.smppToProviderBalancerAlgorithm.processBindToProvider();
sessionConfig.setHost(currNode.getIp());
sessionConfig.setPort(Integer.parseInt((String) currNode.getProperties().get("smppPort")));
clientSessions.put(sessionId, new ClientConnectionImpl(sessionId, sessionConfig, this, monitorExecutor, balancerRunner, packet, currNode));
handlerService.execute(new BinderRunnable(sessionId, packet, serverSessions, clientSessions, currNode, balancerRunner));
}
use of org.mobicents.tools.smpp.balancer.impl.BinderRunnable in project load-balancer by RestComm.
the class BalancerDispatcher method connectionLost.
@Override
public void connectionLost(Long sessionId, Pdu packet, Node node) {
serverSessions.get(sessionId).reconnectState(true);
monitorExecutor.schedule(new BinderRunnable(sessionId, packet, serverSessions, clientSessions, node, balancerRunner), reconnectPeriod, TimeUnit.MILLISECONDS);
}
Aggregations