Package net.tomp2p.futures

Examples of net.tomp2p.futures.FutureDiscover.failedReason()


                } else {
                  return null;
                }
            }
            else {
                log.warn("Discover with direct connection failed. Reason = " + futureDiscover.failedReason());
                peer.shutdown().awaitUninterruptibly();
                return null;
            }
        } catch (IOException e) {
            log.warn("Discover with direct connection failed. Exception = " + e.getMessage());
View Full Code Here


                            .peerAddress());
                    //cachedPeers.put(id, peer);
                    return peer;
                }
                else {
                    log.warn("Discover with automatic port forwarding failed. Reason = " + futureDiscover
                            .failedReason());
                    peer.shutdown().awaitUninterruptibly();
                    return null;
                }
            }
View Full Code Here

    System.out.println(addressList.size());

    if (futureDiscover.isSuccess()) {
      System.out.println("found that my outside address is " + futureDiscover.peerAddress());
    } else {
      System.out.println("failed " + futureDiscover.failedReason());
    }
    client.shutdown();
  }

}
View Full Code Here

   
    frn.awaitUninterruptibly();
    if (fd.isSuccess()) {
      System.out.println("found that my outside address is " + fd.peerAddress());
    } else {
      System.out.println("failed " + fd.failedReason());
    }
   
    if (fn.isSuccess()) {
      System.out.println("NAT success: " + fn.peerAddress());
    } else {
View Full Code Here

        try {
            master = new PeerBuilder(new Number160(rnd)).ports(4001).start();
            slave = new PeerBuilder(new Number160(rnd)).ports(4002).start();
            FutureDiscover fd = master.discover().peerAddress(slave.peerAddress()).start();
            fd.awaitUninterruptibly();
            System.err.println(fd.failedReason());
            Assert.assertEquals(true, fd.isSuccess());
        } finally {
            if (master != null) {
                master.shutdown().await();
            }
View Full Code Here

    System.out.println("About to wait...");
    fd.awaitUninterruptibly();
    if (fd.isSuccess()) {
      System.out.println("*** FOUND THAT MY OUTSIDE ADDRESS IS " + fd.peerAddress());
    } else {
      System.out.println("*** FAILED " + fd.failedReason());
    }

    bootStrapServer = fd.reporter();
    FutureBootstrap bootstrap = peer.peer().bootstrap().peerAddress(bootStrapServer).start();
    bootstrap.awaitUninterruptibly();
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.