Examples of failedReason()


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

              System.err.println(dr.existingBroadcastAddresses());
            }
           
            BaseFuture tmp = client.ping().broadcast().port(4000).start();
            tmp.awaitUninterruptibly();
            System.err.println(tmp.failedReason());
            Assert.assertEquals(true, tmp.isSuccess());

            Assert.assertEquals(1, client.peerBean().peerMap().size());
        } finally {
            if (client != null) {
View Full Code Here

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

            slave = new PeerBuilder(new Number160(rnd)).ports(4002).start();
            FutureBootstrap fb = master.bootstrap().inetAddress(InetAddress.getByName("127.0.0.1"))
                    .ports(3000).start();
            fb.awaitUninterruptibly();
            Assert.assertEquals(false, fb.isSuccess());
            System.err.println(fb.failedReason());
            fb = master.bootstrap().peerAddress(slave.peerAddress()).start();
            fb.awaitUninterruptibly();
            Assert.assertEquals(true, fb.isSuccess());

        } finally {
View Full Code Here

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

        Assert.assertEquals("yoo!", futureResponse.object());
       
        FuturePeerConnection pcSlave = myDirectDataRPC.peerConnection();
       
        futureResponse = slave.sendDirect(pcSlave).object("hello").start().awaitUninterruptibly();
        System.err.println(futureResponse.failedReason());
        Assert.assertEquals("world!", futureResponse.object());
       
        Thread.sleep(1000);
        pcSlave.close();
        pcMaster.close();
View Full Code Here

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

            // we reuse the connection
            long start = System.currentTimeMillis();
            System.out.println("send " + sentObject);
            fd = peer1.sendDirect(fpc).object(sentObject).start();
            fd.awaitUninterruptibly();
            System.err.println(fd.failedReason());
            Assert.assertEquals(true, fd.isSuccess());
            System.err.println(fd.failedReason());
            System.out.println("received " + fd.object() + " connections: "
                    + ccohTCP.total());
            // now we don't want to keep the connection open anymore:
View Full Code Here

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

            System.out.println("send " + sentObject);
            fd = peer1.sendDirect(fpc).object(sentObject).start();
            fd.awaitUninterruptibly();
            System.err.println(fd.failedReason());
            Assert.assertEquals(true, fd.isSuccess());
            System.err.println(fd.failedReason());
            System.out.println("received " + fd.object() + " connections: "
                    + ccohTCP.total());
            // now we don't want to keep the connection open anymore:
            double duration = (System.currentTimeMillis() - start) / 1000d;
            System.out.println("Send and get in s:" + duration);
View Full Code Here

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

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

                            .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

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

    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

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

   
    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

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

        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
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.