@Override public void run() { SmppSession smppSession = smppClient.getSession(); if (smppSession != null && smppSession.isBound()) { try { smppSession.enquireLink(new EnquireLink(), enquireLinkTimeout); } catch (SmppTimeoutException | SmppChannelException | RecoverablePduException | UnrecoverablePduException error) { LOGGER.warn("Enquire link failed, executing reconnect: ", error); smppClient.scheduleReconnect(); } catch (InterruptedException error) { LOGGER.info("Enquire link interrupted, probably killed by reconnecting"); } } else { LOGGER.warn("Enquire link running while session is not connected"); } }
@Override public synchronized void sendMessageSync(String destAddress, String message, boolean command) throws MessageException, InterruptedException, IllegalStateException { if (getSession() != null && getSession().isBound()) { try { SubmitSm submit = new SubmitSm();
public void bind() { if ( this.state == ClientState.BOUND || this.state == ClientState.IDLE ) { log.debug("Binding state"); if ( this.session != null && this.session.isBound() ) { this.session.close(); this.session.destroy(); } this.state = ClientState.BINDING; if (elinkTask != null) { this.elinkTask.cancel(true); } runRebindTask(); } }
@Override protected void _stop() throws Exception { if (this.smppSession != null) { if (this.smppSession.isBinding() || this.smppSession.isBound()) this.smppSession.unbind(this.timeout); this.smppSession.destroy(); } if (this.clientBootstrap != null) this.clientBootstrap.destroy(); if (this.monitorExecutor != null) this.monitorExecutor.shutdownNow(); }
@Override protected void handleDelayedRecord(DelayedRecord delayedRecord) throws Exception { SmppSession session = delayedRecord.getUsedSession(sessionManager); PduRequest request = delayedRecord.getRequest(sessionManager.getNextSequenceNumber()); if (session != null && session.isBound()) { session.sendRequestPdu(request, sendTimoutMilis, false); } else { logger.info("Session does not exist or is not bound {}. Request not sent {}", session, request); } }
if (smppSession != null && smppSession.isBound()) { try { smppSession.enquireLink(new EnquireLink(), 10000);
if (smppSession != null && smppSession.isBound()) { try { smppSession.enquireLink(new EnquireLink(), 10000);
if ((smppSession != null && smppSession.isBound()) || (smppSession != null && smppSession.isBinding())) {
if ((smppSession != null && smppSession.isBound()) || (smppSession != null && smppSession.isBinding())) {