Package net.tomp2p.futures

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


            Collection<PeerAddress> bootstrapTo = new ArrayList<PeerAddress>(2);
            PeerAddress pa = new PeerAddress(new Number160(rnd), "192.168.77.77", 4000, 4000);
            bootstrapTo.add(peer.peerAddress());
            bootstrapTo.add(pa);
            FutureBootstrap tmp = peer.bootstrap().bootstrapTo(bootstrapTo).start();
            tmp.awaitUninterruptibly();
            Assert.assertEquals(false, tmp.isSuccess());
        } finally {
            if (peer != null) {
                peer.shutdown().await();
            }
View Full Code Here


      System.out.println("*** FAILED " + fd.failedReason());
    }

    bootStrapServer = fd.reporter();
    FutureBootstrap bootstrap = peer.peer().bootstrap().peerAddress(bootStrapServer).start();
    bootstrap.awaitUninterruptibly();
    if (!bootstrap.isSuccess()) {
      System.out.println("*** COULD NOT BOOTSTRAP!");
    } else {
      System.out.println("*** SUCCESSFUL BOOTSTRAP");
    }
View Full Code Here

            e.printStackTrace();
            Assert.fail();
            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();
View Full Code Here

      // setup (step 1)
      Bindings b = new Bindings().addInterface("lo");
      p1 = new PeerBuilder(new Number160(rnd)).ports(4001).bindings(b).start();
      p2 = new PeerBuilder(new Number160(rnd)).ports(4002).bindings(b).start();
      FutureBootstrap fb = p2.bootstrap().peerAddress(p1.peerAddress()).start();
      fb.awaitUninterruptibly();
      Assert.assertEquals(true, fb.isSuccess());
    } finally {
      if (p1 != null) {
        p1.shutdown().await();
      }
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.