Package net.tomp2p.rpc

Examples of net.tomp2p.rpc.NeighborRPC$SearchValues


            sender = new PeerBuilderDHT(new PeerBuilder(new Number160("0x50")).p2pId(55).ports(2424).start()).start();
            PeerAddress[] pa = UtilsDHT2.createDummyAddress(300, PORT_TCP, PORT_UDP);
            for (int i = 0; i < pa.length; i++) {
                sender.peerBean().peerMap().peerFound(pa[i], null, null);
            }
            new NeighborRPC(sender.peerBean(), sender.peer().connectionBean());
            recv1 = new PeerBuilderDHT(new PeerBuilder(new Number160("0x20")).p2pId(55).ports(8088).start()).start();
            NeighborRPC neighbors2 = new NeighborRPC(recv1.peerBean(), recv1.peer().connectionBean());
            FutureChannelCreator fcc = recv1.peer().connectionBean().reservation().create(1, 0);

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

            SimpleBloomFilter<Number160> bf = new SimpleBloomFilter<Number160>(20, 10);
            for (int i = 0; i < 10; i++) {
                Number640 key = new Number640(new Number160(0x1), Number160.ZERO, Number160.createHash(i), Number160.ZERO);
                sender.storageLayer().put(key, new Data("test"), null, false, false);
                bf.add(Number160.createHash(i));
            }

            SearchValues v = new SearchValues(new Number160("0x1"), null, bf);
            FutureResponse fr = neighbors2.closeNeighbors(sender.peerAddress(), v,
                    Type.REQUEST_2, cc, new DefaultConnectionConfiguration());

            fr.awaitUninterruptibly();
            // Thread.sleep(10000000);
            Assert.assertEquals(true, fr.isSuccess());
View Full Code Here


      quitRPC.addPeerStatusListener(peerMap);
      peer.quitRPC(quitRPC);
    }

    if (isEnableNeighborRPC()) {
      NeighborRPC neighborRPC = new NeighborRPC(peerBean, connectionBean);
      peer.neighborRPC(neighborRPC);
    }

    if (isEnableDirectDataRPC()) {
      DirectDataRPC directDataRPC = new DirectDataRPC(peerBean, connectionBean);
View Full Code Here

TOP

Related Classes of net.tomp2p.rpc.NeighborRPC$SearchValues

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.