Package net.tomp2p.futures

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


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

            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

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.