Package net.tomp2p.p2p

Examples of net.tomp2p.p2p.PeerMaker


    @Test
    public void testRPC2() throws Exception {
        Peer peer1 = null;
        Peer peer2 = null;
        try {
            peer1 = new PeerMaker(new Number160(rnd)).setWorkerThreads(1).setPorts(4001).setEnableTask(true)
                    .makeAndListen();
            peer2 = new PeerMaker(new Number160(rnd)).setWorkerThreads(1).setPorts(4002).setEnableTask(true)
                    .makeAndListen();
            FutureChannelCreator futureChannelCreator = peer1.getConnectionBean().getConnectionReservation().reserve(5);
            futureChannelCreator.awaitUninterruptibly();
            Number160 taskId1 = new Number160(11);
            Number160 taskId2 = new Number160(12);
View Full Code Here


    @Test
    public void testRPCAsync() throws Exception {
        Peer peer1 = null;
        Peer peer2 = null;
        try {
            peer1 = new PeerMaker(new Number160(rnd)).setWorkerThreads(1).setPorts(4001).setEnableTask(true)
                    .makeAndListen();
            peer2 = new PeerMaker(new Number160(rnd)).setWorkerThreads(1).setPorts(4002).setEnableTask(true)
                    .makeAndListen();
            FutureChannelCreator futureChannelCreator = peer1.getConnectionBean().getConnectionReservation().reserve(1);
            futureChannelCreator.awaitUninterruptibly();
            Number160 taskId = new Number160(11);
            Map<Number160, Data> dataMap = new HashMap<Number160, Data>();
View Full Code Here

    @Test
    public void testRPCAsyncFailed() throws Exception {
        Peer peer1 = null;
        Peer peer2 = null;
        try {
            peer1 = new PeerMaker(new Number160(rnd)).setWorkerThreads(1).setPorts(4001).setEnableTask(true)
                    .makeAndListen();
            peer2 = new PeerMaker(new Number160(rnd)).setWorkerThreads(1).setPorts(4002).setEnableTask(true)
                    .makeAndListen();
            FutureChannelCreator futureChannelCreator = peer1.getConnectionBean().getConnectionReservation().reserve(1);
            futureChannelCreator.awaitUninterruptibly();
            Number160 taskId = new Number160(11);
            Map<Number160, Data> dataMap = new HashMap<Number160, Data>();
View Full Code Here

TOP

Related Classes of net.tomp2p.p2p.PeerMaker

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.