Search in sources :

Example 1 with Pdu

use of com.cloudhopper.smpp.pdu.Pdu in project load-balancer by RestComm.

the class ClientConnectionHandlerImpl method messageReceived.

@Override
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) {
    if (e.getMessage() instanceof Pdu) {
        Pdu pdu = (Pdu) e.getMessage();
        listener.packetReceived(pdu);
    }
}
Also used : Pdu(com.cloudhopper.smpp.pdu.Pdu)

Example 2 with Pdu

use of com.cloudhopper.smpp.pdu.Pdu in project load-balancer by RestComm.

the class ServerConnectionImpl 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);
    }
    if (logger.isDebugEnabled())
        logger.debug("LB sent enquire_link request (" + packet + ") to " + channel.getRemoteAddress().toString() + ". session ID : " + 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)

Example 3 with Pdu

use of com.cloudhopper.smpp.pdu.Pdu in project load-balancer by RestComm.

the class MServerConnectionImpl 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);
    }
    if (logger.isDebugEnabled())
        logger.debug("LB sent enquire_link request (" + packet + ") to server " + channel.getRemoteAddress().toString() + ". session ID : " + 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)

Example 4 with Pdu

use of com.cloudhopper.smpp.pdu.Pdu 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)

Example 5 with Pdu

use of com.cloudhopper.smpp.pdu.Pdu in project load-balancer by RestComm.

the class ServerConnectionHandlerImpl method messageReceived.

@Override
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) {
    if (e.getMessage() instanceof Pdu) {
        Pdu pdu = (Pdu) e.getMessage();
        this.listener.packetReceived(pdu);
    }
}
Also used : Pdu(com.cloudhopper.smpp.pdu.Pdu)

Aggregations

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