Search in sources :

Example 1 with ServerTimerConnectionCheck

use of org.mobicents.tools.smpp.balancer.timers.ServerTimerConnectionCheck in project load-balancer by RestComm.

the class ClientConnectionImpl method generateEnquireLink.

@Override
public void generateEnquireLink() {
    Pdu packet = new EnquireLink();
    packet.setSequenceNumber(lastSequenceNumberSent.incrementAndGet());
    ChannelBuffer buffer = null;
    try {
        buffer = transcoder.encode(packet);
    } catch (UnrecoverablePduException e) {
        logger.error("Encode error: ", e);
    } catch (RecoverablePduException e) {
        logger.error("Encode error: ", e);
    }
    isEnquireLinkSent = true;
    connectionCheck = new ServerTimerConnectionCheck(this);
    // connectionCheckServerSideTimer = monitorExecutor.schedule(connectionCheck,timeoutConnectionCheckServerSide,TimeUnit.MILLISECONDS);
    if (logger.isDebugEnabled())
        logger.debug("LB sent enquire_link to " + channel.getRemoteAddress().toString() + ". sessionId : " + sessionId);
    channel.write(buffer);
}
Also used : Pdu(com.cloudhopper.smpp.pdu.Pdu) EnquireLink(com.cloudhopper.smpp.pdu.EnquireLink) RecoverablePduException(com.cloudhopper.smpp.type.RecoverablePduException) UnrecoverablePduException(com.cloudhopper.smpp.type.UnrecoverablePduException) ChannelBuffer(org.jboss.netty.buffer.ChannelBuffer) ServerTimerConnectionCheck(org.mobicents.tools.smpp.balancer.timers.ServerTimerConnectionCheck)

Aggregations

EnquireLink (com.cloudhopper.smpp.pdu.EnquireLink)1 Pdu (com.cloudhopper.smpp.pdu.Pdu)1 RecoverablePduException (com.cloudhopper.smpp.type.RecoverablePduException)1 UnrecoverablePduException (com.cloudhopper.smpp.type.UnrecoverablePduException)1 ChannelBuffer (org.jboss.netty.buffer.ChannelBuffer)1 ServerTimerConnectionCheck (org.mobicents.tools.smpp.balancer.timers.ServerTimerConnectionCheck)1