Examples of peerBean()


Examples of net.tomp2p.p2p.Peer.peerBean()

        try {
            sender = new PeerBuilder(new Number160("0x9876")).p2pId(55).ports(2424).start();
            PingRPC handshake = new PingRPC(sender.peerBean(), sender.connectionBean(), false, true,
                    true);
            recv1 = new PeerBuilder(new Number160("0x1234")).p2pId(55).ports(8088).start();
            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());
View Full Code Here

Examples of net.tomp2p.p2p.Peer.peerBean()

            recv1 = new PeerBuilder(new Number160("0x1234")).p2pId(55).ports(8088).start();
            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

Examples of net.tomp2p.p2p.Peer.peerBean()

        try {
            sender = new PeerBuilder(new Number160("0x9876")).p2pId(55).ports(2424).start();
            PingRPC handshake = new PingRPC(sender.peerBean(), sender.connectionBean(), false, true,
                    false);
            recv1 = new PeerBuilder(new Number160("0x1234")).p2pId(55).ports(8088).start();
            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());
View Full Code Here

Examples of net.tomp2p.p2p.Peer.peerBean()

            recv1 = new PeerBuilder(new Number160("0x1234")).p2pId(55).ports(8088).start();
            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) {
View Full Code Here

Examples of net.tomp2p.p2p.Peer.peerBean()

        try {
            sender = new PeerBuilder(new Number160("0x9876")).p2pId(55).ports(2424).start();
            PingRPC handshake = new PingRPC(sender.peerBean(), sender.connectionBean(), false, true,
                    true);
            recv1 = new PeerBuilder(new Number160("0x1234")).p2pId(55).ports(8088).start();
            new PingRPC(recv1.peerBean(), recv1.connectionBean(), false, true, true);
            FutureChannelCreator fcc = recv1.connectionBean().reservation().create(1, 0);
            fcc.awaitUninterruptibly();
            cc = fcc.channelCreator();
            FutureResponse fr = handshake.pingUDP(recv1.peerBean().serverPeerAddress(), cc,
                    new DefaultConnectionConfiguration());
View Full Code Here

Examples of net.tomp2p.p2p.Peer.peerBean()

            recv1 = new PeerBuilder(new Number160("0x1234")).p2pId(55).ports(8088).start();
            new PingRPC(recv1.peerBean(), recv1.connectionBean(), false, true, true);
            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());
            System.err.println("done:" + fr.failedReason());
            Assert.assertEquals(true, fr.failedReason().contains("/ timeout"));
View Full Code Here

Examples of net.tomp2p.p2p.Peer.peerBean()

    public void startServer() throws IOException {
        Random r = new Random(Utils2.THE_ANSWER);
        Bindings b = new Bindings().addProtocol(StandardProtocolFamily.INET6);
        Peer peer = new PeerBuilder(new Number160(r)).bindings(b).ports(port).start();
        for (int i = 0; i < Integer.MAX_VALUE; i++) {
            for (PeerAddress pa : peer.peerBean().peerMap().all()) {
               
                FutureChannelCreator fcc = peer.connectionBean().reservation().create(1, 1);
                fcc.awaitUninterruptibly();
                ChannelCreator cc = fcc.channelCreator();
               
View Full Code Here

Examples of net.tomp2p.p2p.Peer.peerBean()

    // b.addInterface("eth0");
    Peer master = new PeerBuilder(new Number160(rnd)).ports(4000).bindings(b).start();
    System.out.println("Server started Listening to: " + DiscoverNetworks.discoverInterfaces(b));
    System.out.println("address visible to outside is " + master.peerAddress());
    while (true) {
      for (PeerAddress pa : master.peerBean().peerMap().all()) {
        System.out.println("PeerAddress: " + pa);
        FutureChannelCreator fcc = master.connectionBean().reservation().create(1, 1);
        fcc.awaitUninterruptibly();

        ChannelCreator cc = fcc.channelCreator();
View Full Code Here

Examples of net.tomp2p.p2p.Peer.peerBean()

    // Future Bootstrap - slave
    FutureBootstrap futureBootstrap = client.bootstrap().inetAddress(address).ports(masterPort).start();
    futureBootstrap.awaitUninterruptibly();

    Collection<PeerAddress> addressList = client.peerBean().peerMap().all();
    System.out.println(addressList.size());

    if (futureDiscover.isSuccess()) {
      System.out.println("found that my outside address is " + futureDiscover.peerAddress());
    } else {
View Full Code Here

Examples of net.tomp2p.p2p.Peer.peerBean()

            Peer recv1Peer = new PeerBuilder(new Number160("0x1234")).p2pId(55).ports(8088).start();
           
           
            final CountDownLatch c = new CountDownLatch(2);
            TrackerStorage trackerStorage = new TrackerStorage(60, new int[]{1,2}, 20, recv1Peer.peerBean().peerMap(), recv1.peerAddress(), false);
            Random rnd = new Random(42);
            PeerBuilderTracker.DefaultPeerExchangeHandler pe = new PeerBuilderTracker.DefaultPeerExchangeHandler(trackerStorage, recv1Peer.peerAddress(), rnd) {
              @Override
              public boolean put(Number320 key, TrackerData trackerData, PeerAddress referrer) {
                  boolean retVal = super.put(key, trackerData, referrer);
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.