Пример #1
0
 private void sleep() {
   try {
     Thread.sleep(TIMEOUT);
   } catch (InterruptedException e) {
     e.printStackTrace();
   }
 }
  @Override
  public void start() throws SmppChannelException {
    if (isDestroyed()) {
      throw new SmppChannelException("Unable to start: server is destroyed");
    }
    try {
      ChannelFuture f = this.serverBootstrap.bind(new InetSocketAddress(configuration.getPort()));

      // wait until the connection is made successfully
      boolean timeout = !f.await(configuration.getBindTimeout());

      if (timeout || !f.isSuccess())
        throw new SmppChannelException(
            "Can't bind to port "
                + configuration.getPort()
                + " after "
                + configuration.getBindTimeout()
                + " milliseconds");

      logger.info("{} started on SMPP port [{}]", configuration.getName(), configuration.getPort());
      serverChannel = f.channel();
    } catch (ChannelException e) {
      throw new SmppChannelException(e.getMessage(), e);
    } catch (InterruptedException e) {
      throw new SmppChannelException(e.getMessage(), e);
    }
  }
Пример #3
0
    public void run() {
      try {

        ChannelFuture cf = tcpBootstrap.connect("192.168.5.86", 554).sync();

      } catch (InterruptedException e) {
        e.printStackTrace();
      }
    }