protected DefaultSmppSession doOpen(SmppSessionConfiguration config, SmppSessionHandler sessionHandler) throws SmppTimeoutException, SmppChannelException, InterruptedException { // create and connect a channel to the remote host Channel channel = createConnectedChannel(config.getHost(), config.getPort(), config.getConnectTimeout()); // tie this new opened channel with a new session return createSession(channel, config, sessionHandler); }
protected DefaultSmppSession doOpen(SmppSessionConfiguration config, SmppSessionHandler sessionHandler) throws SmppTimeoutException, SmppChannelException, InterruptedException { // create and connect a channel to the remote host Channel channel = createConnectedChannel(config.getHost(), config.getPort(), config.getConnectTimeout()); // tie this new opened channel with a new session return createSession(channel, config, sessionHandler); }
protected DefaultSmppSession doOpen(SmppSessionConfiguration config, SmppSessionHandler sessionHandler) throws SmppTimeoutException, SmppChannelException, InterruptedException { // create and connect a channel to the remote host Channel channel = createConnectedChannel(config.getHost(), config.getPort(), config.getConnectTimeout()); // tie this new opened channel with a new session return createSession(channel, config, sessionHandler); }
protected DefaultSmppSession doOpen(SmppSessionConfiguration config, SmppSessionHandler sessionHandler) throws SmppTimeoutException, SmppChannelException, InterruptedException { // create and connect a channel to the remote host Channel channel = createConnectedChannel(config.getHost(), config.getPort(), config.getConnectTimeout()); // tie this new opened channel with a new session return createSession(channel, config, sessionHandler); }
@Override public SmppSession bind(SmppSessionConfiguration config, SmppSessionHandler sessionHandler) throws SmppTimeoutException, SmppChannelException, SmppBindException, UnrecoverablePduException, InterruptedException { DefaultSmppSession session = null; try { // connect to the remote system and create the session logger.debug("Connecting to remote system " + config.getName() + " host " + config.getHost() + ":" + config.getPort()); session = doOpen(config, sessionHandler); // try to bind to the remote system (may throw an exception) logger.debug("Binding to remote system " + config.getName()); doBind(session, config, sessionHandler); logger.debug("Successfully bound to " + config.getName()); } finally { // close the session if we weren't able to bind correctly if (session != null && !session.isBound()) { // make sure that the resources are always cleaned up try { logger.debug("Closing session - not able to bind to " + config.getName()); session.close(); } catch (Exception e) { logger.debug("Exception while trying to close connection to " + config.getName(), e); } } } return session; }
logger.error(String.format("No ESME for Name=%s SystemId=%s Host=%s Port=%d SmppBindType=%s", sessionConfiguration.getSystemId(), sessionConfiguration.getHost(), sessionConfiguration.getPort(), sessionConfiguration.getType())); throw new SmppProcessingException(SmppConstants.STATUS_BINDFAIL);
logger.error(String.format("No ESME for Name=%s SystemId=%s Host=%s Port=%d SmppBindType=%s", sessionConfiguration.getSystemId(), sessionConfiguration.getHost(), sessionConfiguration.getPort(), sessionConfiguration.getType())); throw new SmppProcessingException(SmppConstants.STATUS_BINDFAIL);