Package net.tomp2p.futures

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


                FutureResponse fr1 = sender.pingRPC().pingTCP(recv1.peerAddress(), cc, new DefaultConnectionConfiguration());
                FutureResponse fr2 = sender.pingRPC().pingTCP(recv1.peerAddress(), cc, new DefaultConnectionConfiguration());
                FutureResponse fr3 = sender.pingRPC().pingTCP(recv1.peerAddress(), cc, new DefaultConnectionConfiguration());
                fr1.awaitUninterruptibly();
                fr2.awaitUninterruptibly();
                fr3.awaitUninterruptibly();
                System.err.println(fr1.failedReason() + " / " + fr2.failedReason() + " / "
                        + fr3.failedReason());
                Assert.assertEquals(true, fr1.isSuccess());
                Assert.assertEquals(true, fr2.isSuccess());
                Assert.assertEquals(true, fr3.isSuccess());
View Full Code Here


                FutureResponse fr1 = sender.pingRPC().pingUDP(recv1.peerAddress(), cc, new DefaultConnectionConfiguration());
                FutureResponse fr2 = sender.pingRPC().pingUDP(recv1.peerAddress(), cc, new DefaultConnectionConfiguration());
                FutureResponse fr3 = sender.pingRPC().pingUDP(recv1.peerAddress(), cc, new DefaultConnectionConfiguration());
                fr1.awaitUninterruptibly();
                fr2.awaitUninterruptibly();
                fr3.awaitUninterruptibly();
                System.err.println(fr1.failedReason() + " / " + fr2.failedReason() + " / "
                        + fr3.failedReason());
                Assert.assertEquals(true, fr1.isSuccess());
                Assert.assertEquals(true, fr2.isSuccess());
                Assert.assertEquals(true, fr3.isSuccess());
View Full Code Here

                FutureChannelCreator fcc = peer.connectionBean().reservation().create(1, 1);
                fcc.awaitUninterruptibly();
                ChannelCreator cc = fcc.channelCreator();
               
                FutureResponse fr1 = peer.pingRPC().pingTCP(pa, cc, new DefaultConnectionConfiguration());
                fr1.awaitUninterruptibly();

                if (fr1.isSuccess()) {
                    System.out.println("peer online TCP:" + pa);
                } else {
                    System.out.println("offline " + pa);
View Full Code Here

                    System.out.println("peer online TCP:" + pa);
                } else {
                    System.out.println("offline " + pa);
                }
                FutureResponse fr2 = peer.pingRPC().pingUDP(pa, cc, new DefaultConnectionConfiguration());
                fr2.awaitUninterruptibly();
                cc.shutdown().awaitUninterruptibly();
                if (fr2.isSuccess()) {
                    System.out.println("peer online UDP:" + pa);
                } else {
                    System.out.println("offline " + pa);
View Full Code Here

        fcc.awaitUninterruptibly();

        ChannelCreator cc = fcc.channelCreator();

        FutureResponse fr1 = master.pingRPC().pingTCP(pa, cc, new DefaultConnectionConfiguration());
        fr1.awaitUninterruptibly();

        if (fr1.isSuccess()) {
          System.out.println("peer online T:" + pa);
        } else {
          System.out.println("offline " + pa);
View Full Code Here

        } else {
          System.out.println("offline " + pa);
        }

        FutureResponse fr2 = master.pingRPC().pingUDP(pa, cc, new DefaultConnectionConfiguration());
        fr2.awaitUninterruptibly();

        cc.shutdown();

        if (fr2.isSuccess()) {
          System.out.println("peer online U:" + pa);
View Full Code Here

            fcc.awaitUninterruptibly();
            cc = fcc.channelCreator();

            FutureResponse fr = sender.pingRPC().pingTCP(recv1.peerAddress(), cc,
                    new DefaultConnectionConfiguration());
            fr.awaitUninterruptibly();
            Assert.assertEquals(true, fr.isSuccess());
        } finally {
            if (cc != null) {
                cc.shutdown().await();
            }
View Full Code Here

            fcc.awaitUninterruptibly();
            cc = fcc.channelCreator();

            FutureResponse fr = sender.pingRPC().pingTCP(recv1.peerAddress(), cc,
                    new DefaultConnectionConfiguration());
            fr.awaitUninterruptibly();
            FutureResponse fr2 = recv1.pingRPC().pingTCP(sender.peerAddress(), cc,
                    new DefaultConnectionConfiguration());
            fr2.awaitUninterruptibly();
            Assert.assertEquals(true, fr2.isSuccess());
            Assert.assertEquals(true, fr.isSuccess());
View Full Code Here

            FutureResponse fr = sender.pingRPC().pingTCP(recv1.peerAddress(), cc,
                    new DefaultConnectionConfiguration());
            fr.awaitUninterruptibly();
            FutureResponse fr2 = recv1.pingRPC().pingTCP(sender.peerAddress(), cc,
                    new DefaultConnectionConfiguration());
            fr2.awaitUninterruptibly();
            Assert.assertEquals(true, fr2.isSuccess());
            Assert.assertEquals(true, fr.isSuccess());
        } finally {
            if (cc != null) {
                cc.shutdown().await();
View Full Code Here

            cc = fcc.channelCreator();
            final ChannelCreator cc1 = cc;

            FutureResponse fr = sender.pingRPC().pingTCP(recv1.peerAddress(), cc,
                    new DefaultConnectionConfiguration());
            fr.awaitUninterruptibly();

            fr.addListener(new BaseFutureAdapter<FutureResponse>() {
                @Override
                public void operationComplete(final FutureResponse future) throws Exception {
                    FutureResponse fr2 = sender.pingRPC().pingTCP(recv1.peerAddress(), cc1,
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.