use of com.cloudhopper.smpp.type.RecoverablePduException in project load-balancer by RestComm.
the class MClientConnectionImpl 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 to client " + channel.getRemoteAddress().toString() + ". client sessionID : " + serverSessionID);
channel.write(buffer);
}
use of com.cloudhopper.smpp.type.RecoverablePduException in project load-balancer by RestComm.
the class MClientConnectionImpl method sendSmppRequest.
@Override
public void sendSmppRequest(Long sessionId, Pdu packet) {
Integer currSequence = lastSequenceNumberSent.incrementAndGet();
sequenceCustomerMap.put(currSequence, new CustomerPacket(sessionId, 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 client " + channel.getRemoteAddress().toString() + ". client session ID : " + serverSessionID + " from client with sessionId : " + sessionId);
channel.write(buffer);
}
use of com.cloudhopper.smpp.type.RecoverablePduException in project load-balancer by RestComm.
the class MClientConnectionImpl method sendUnbindResponse.
@Override
public void sendUnbindResponse(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);
}
clientState = ClientState.CLOSED;
sequenceMap.clear();
packetMap.clear();
if (logger.isDebugEnabled())
logger.debug("LB sent unbind response (" + packet + ") to client " + channel.getRemoteAddress().toString() + ". client session ID : " + serverSessionID);
channel.write(buffer);
closeChannel();
}
use of com.cloudhopper.smpp.type.RecoverablePduException in project load-balancer by RestComm.
the class MClientConnectionImpl method sendUnbindRequest.
@Override
public void sendUnbindRequest(Pdu packet) {
enquireRunnable.cancel();
enquireTimer.cancel(false);
connectionCheck.cancel();
connectionCheckServerSideTimer.cancel(false);
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);
}
clientState = ClientState.UNBINDING;
if (logger.isDebugEnabled())
logger.debug("LB sent unbind request (" + packet + ") to client " + channel.getRemoteAddress().toString() + ". client session ID : " + serverSessionID);
channel.write(buffer);
}
use of com.cloudhopper.smpp.type.RecoverablePduException in project load-balancer by RestComm.
the class MServerConnectionImpl method sendRequest.
@Override
public void sendRequest(Long serverSessionID, Pdu packet) {
Integer currSequence = lastSequenceNumberSent.incrementAndGet();
sequenceMap.put(currSequence, new CustomerPacket(serverSessionID, 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 server " + channel.getRemoteAddress().toString() + ". session ID : " + sessionId);
channel.write(buffer);
}
Aggregations