Search in sources :

Example 1 with GenericNack

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

the class ServerConnectionImpl method sendGenericNack.

/**
 *Send generic_nack to client if unable to convert request
 *from client
 *@param packet PDU packet
 */
private void sendGenericNack(Pdu packet) {
    GenericNack genericNack = new GenericNack();
    genericNack.setSequenceNumber(packet.getSequenceNumber());
    genericNack.setCommandStatus(SmppConstants.STATUS_INVCMDID);
    ChannelBuffer buffer = null;
    try {
        buffer = transcoder.encode(genericNack);
    } catch (UnrecoverablePduException e) {
        logger.error("Encode error: ", e);
    } catch (RecoverablePduException e) {
        logger.error("Encode error: ", e);
    }
    if (logger.isDebugEnabled())
        logger.debug("LB sent generic_nack response for packet (" + packet + ") to " + channel.getRemoteAddress().toString() + ". session ID : " + sessionId);
    channel.write(buffer);
}
Also used : GenericNack(com.cloudhopper.smpp.pdu.GenericNack) RecoverablePduException(com.cloudhopper.smpp.type.RecoverablePduException) UnrecoverablePduException(com.cloudhopper.smpp.type.UnrecoverablePduException) ChannelBuffer(org.jboss.netty.buffer.ChannelBuffer)

Example 2 with GenericNack

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

the class MServerConnectionImpl method sendGenericNack.

/**
 *Send generic_nack to client if unable to convert request
 *from client
 *@param packet PDU packet
 */
private void sendGenericNack(Pdu packet) {
    GenericNack genericNack = new GenericNack();
    genericNack.setSequenceNumber(packet.getSequenceNumber());
    genericNack.setCommandStatus(SmppConstants.STATUS_INVCMDID);
    ChannelBuffer buffer = null;
    try {
        buffer = transcoder.encode(genericNack);
    } catch (UnrecoverablePduException e) {
        logger.error("Encode error: ", e);
    } catch (RecoverablePduException e) {
        logger.error("Encode error: ", e);
    }
    if (logger.isDebugEnabled())
        logger.debug("LB sent generic_nack response for packet (" + packet + ") to server " + channel.getRemoteAddress().toString() + ". session ID : " + sessionId);
    channel.write(buffer);
}
Also used : GenericNack(com.cloudhopper.smpp.pdu.GenericNack) RecoverablePduException(com.cloudhopper.smpp.type.RecoverablePduException) UnrecoverablePduException(com.cloudhopper.smpp.type.UnrecoverablePduException) ChannelBuffer(org.jboss.netty.buffer.ChannelBuffer)

Aggregations

GenericNack (com.cloudhopper.smpp.pdu.GenericNack)2 RecoverablePduException (com.cloudhopper.smpp.type.RecoverablePduException)2 UnrecoverablePduException (com.cloudhopper.smpp.type.UnrecoverablePduException)2 ChannelBuffer (org.jboss.netty.buffer.ChannelBuffer)2