Package net.tomp2p.connection

Examples of net.tomp2p.connection.DefaultConnectionConfiguration


            FutureChannelCreator fcc = recv1.connectionBean().reservation().create(0, 3);
            fcc.awaitUninterruptibly();
            cc = fcc.channelCreator();

            for (int i = 0; i < 1000; i++) {
                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());
View Full Code Here


            FutureChannelCreator fcc = recv1.connectionBean().reservation().create(3, 0);
            fcc.awaitUninterruptibly();
            cc = fcc.channelCreator();

            for (int i = 0; i < 1000; i++) {
                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());
View Full Code Here

  public RconRPC(final Peer peer) {
    super(peer.peerBean(), peer.connectionBean());
    register(RPC.Commands.RCON.getNr());
    this.peer = peer;
    this.config = new DefaultConnectionConfiguration();
  }
View Full Code Here

            FutureChannelCreator fcc = recv1.connectionBean().reservation().create(0, 1);
            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

            FutureChannelCreator fcc = recv1.connectionBean().reservation().create(0, 1);
            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());
        } finally {
            if (cc != null) {
View Full Code Here

            fcc.awaitUninterruptibly();
            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,
                            new DefaultConnectionConfiguration());
                    try {
                        fr2.await();
                    } catch (IllegalStateException ise) {
                        Assert.fail();
                    }
View Full Code Here

            new PingRPC(recv1.peerBean(), recv1.connectionBean());
            FutureChannelCreator fcc = recv1.connectionBean().reservation().create(1, 0);
            fcc.awaitUninterruptibly();
            cc = fcc.channelCreator();
            FutureResponse fr = handshake.pingUDP(recv1.peerAddress(), cc,
                    new DefaultConnectionConfiguration());
            fr.awaitUninterruptibly();
            Assert.assertEquals(true, fr.isSuccess());
        } finally {
            if (cc != null) {
                cc.shutdown().await();
View Full Code Here

            new PingRPC(recv1.peerBean(), recv1.connectionBean(), false, true, false);
            FutureChannelCreator fcc = recv1.connectionBean().reservation().create(0, 1);
            fcc.awaitUninterruptibly();
            cc = fcc.channelCreator();
            FutureResponse fr = handshake.pingTCP(recv1.peerAddress(), cc,
                    new DefaultConnectionConfiguration());
            fr.awaitUninterruptibly();
            Assert.assertEquals(false, fr.isSuccess());
        } finally {
            if (cc != null) {
                cc.shutdown().await();
View Full Code Here

            new PingRPC(recv1.peerBean(), recv1.connectionBean(), false, true, true);
            FutureChannelCreator fcc = recv1.connectionBean().reservation().create(0, 1);
            fcc.awaitUninterruptibly();
            cc = fcc.channelCreator();
            FutureResponse fr = handshake.pingTCP(recv1.peerBean().serverPeerAddress(), cc,
                    new DefaultConnectionConfiguration());
            fr.awaitUninterruptibly();
            Assert.assertEquals(false, fr.isSuccess());
            System.err.println("done:" + fr.failedReason());
            Assert.assertEquals(true, fr.failedReason().contains("/ timeout"));
           
View Full Code Here

            new PingRPC(recv1.peerBean(), recv1.connectionBean(), false, true, false);
            FutureChannelCreator fcc = recv1.connectionBean().reservation().create(1, 0);
            fcc.awaitUninterruptibly();
            cc = fcc.channelCreator();
            FutureResponse fr = handshake.pingUDP(recv1.peerBean().serverPeerAddress(), cc,
                    new DefaultConnectionConfiguration());
            fr.awaitUninterruptibly();
            Assert.assertEquals(false, fr.isSuccess());
        } finally {
            if (cc != null) {
                cc.shutdown().await();
View Full Code Here

TOP

Related Classes of net.tomp2p.connection.DefaultConnectionConfiguration

Copyright © 2018 www.massapicom. 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.