Package net.tomp2p.futures

Examples of net.tomp2p.futures.FutureBootstrap.addListener()


            return null;
        }
        final FutureBootstrap fb = peer.bootstrap().broadcast().ports(seed.peerAddress().udpPort()).start();
        fb.awaitUninterruptibly();
        peer.discover().peerAddress(fb.bootstrapTo().iterator().next()).start();
        fb.addListener(new BaseFutureListener<BaseFuture>() {
            @Override
            public void operationComplete(BaseFuture future) throws Exception {
                Collection<PeerAddress> addresses = fb.bootstrapTo();
                if (addresses != null && !addresses.isEmpty()) {
                    peer.discover().peerAddress(addresses.iterator().next()).start().awaitUninterruptibly();
View Full Code Here


    // find neighbors

    FutureBootstrap futureBootstrap = bootstrapBuilder.start();
    futureBootstrapNAT.futureBootstrap0(futureBootstrap);

    futureBootstrap.addListener(new BaseFutureAdapter<FutureBootstrap>() {
      @Override
      public void operationComplete(FutureBootstrap future) throws Exception {
        if (future.isSuccess()) {
          // setup relay
          LOG.debug("bootstrap completed");
View Full Code Here

            public void operationComplete(FutureRelay future) throws Exception {
              // find neighbors again
              if (future.isSuccess()) {
                FutureBootstrap futureBootstrap = bootstrapBuilder.start();
                futureBootstrapNAT.futureBootstrap1(futureBootstrap);
                futureBootstrap.addListener(new BaseFutureAdapter<FutureBootstrap>() {
                  @Override
                  public void operationComplete(FutureBootstrap future) throws Exception {
                    if (future.isSuccess()) {
                      Shutdown shutdown = startRelayMaintenance(futureRelay, bootstrapBuilder, distributedRelay);
                      futureBootstrapNAT.done(shutdown);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.