use of com.cloudhopper.smpp.type.UnrecoverablePduException in project load-balancer by RestComm.
the class ServerConnectionImpl method sendRequest.
@Override
public void sendRequest(Pdu packet) {
Integer currSequence = lastSequenceNumberSent.incrementAndGet();
sequenceMap.put(currSequence, packet.getSequenceNumber());
packet.setSequenceNumber(currSequence);
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 SMPP request (" + packet + ") to " + channel.getRemoteAddress().toString() + ". session ID : " + sessionId);
channel.write(buffer);
}
use of com.cloudhopper.smpp.type.UnrecoverablePduException 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);
}
use of com.cloudhopper.smpp.type.UnrecoverablePduException in project load-balancer by RestComm.
the class ServerConnectionImpl method sendResponse.
@Override
public void sendResponse(Pdu packet) {
if (packetMap.containsKey(packet.getSequenceNumber())) {
TimerData data = packetMap.remove(packet.getSequenceNumber());
if (data != null) {
data.getRunnable().cancel();
data.getScheduledFuture().cancel(false);
}
}
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 SMPP response (" + packet + ") to " + channel.getRemoteAddress().toString() + ". session ID : " + sessionId);
channel.write(buffer);
}
use of com.cloudhopper.smpp.type.UnrecoverablePduException in project load-balancer by RestComm.
the class ServerConnectionImpl method sendUnbindRequest.
@Override
public void sendUnbindRequest(Pdu packet) {
Integer currSequence = lastSequenceNumberSent.incrementAndGet();
sequenceMap.put(currSequence, packet.getSequenceNumber());
packet.setSequenceNumber(currSequence);
ChannelBuffer buffer = null;
try {
buffer = transcoder.encode(packet);
} catch (UnrecoverablePduException e) {
logger.error("Encode error: ", e);
} catch (RecoverablePduException e) {
logger.error("Encode error: ", e);
}
serverState = ServerState.UNBINDING;
if (logger.isDebugEnabled())
logger.debug("LB sent unbind request (" + packet + ") to " + channel.getRemoteAddress().toString() + ". session ID : " + sessionId);
channel.write(buffer);
}
use of com.cloudhopper.smpp.type.UnrecoverablePduException in project load-balancer by RestComm.
the class ServerConnectionImpl method sendBindResponse.
@Override
public void sendBindResponse(Pdu packet) {
if (packetMap.containsKey(packet.getSequenceNumber())) {
TimerData data = packetMap.remove(packet.getSequenceNumber());
if (data != null) {
data.getRunnable().cancel();
data.getScheduledFuture().cancel(false);
}
}
ChannelBuffer buffer = null;
try {
buffer = transcoder.encode(packet);
} catch (UnrecoverablePduException e) {
logger.error("Encode error: ", e);
} catch (RecoverablePduException e) {
logger.error("Encode error: ", e);
}
serverState = ServerState.BOUND;
if (logger.isDebugEnabled())
logger.debug("LB sent bind response (" + packet + ") to " + channel.getRemoteAddress().toString() + ". session ID : " + sessionId);
channel.write(buffer);
}
Aggregations