Package net.tomp2p.p2p.builder

Examples of net.tomp2p.p2p.builder.BroadcastBuilder


    public DiscoverBuilder discover() {
        return new DiscoverBuilder(this);
    }

    public BroadcastBuilder broadcast(Number160 messageKey) {
        return new BroadcastBuilder(this, messageKey);
    }
View Full Code Here


            FutureChannelCreator frr = peer.connectionBean().reservation().create(isUDP?1:0, isUDP?0:1);
                    frr.addListener(new BaseFutureAdapter<FutureChannelCreator>() {
                        @Override
                        public void operationComplete(final FutureChannelCreator future) throws Exception {
                            if (future.isSuccess()) {
                                BroadcastBuilder broadcastBuilder = new BroadcastBuilder(peer, messageKey);
                                broadcastBuilder.dataMap(dataMap);
                                broadcastBuilder.hopCounter(hopCounter + 1);
                                broadcastBuilder.udp(isUDP);
                                FutureResponse futureResponse = peer.broadcastRPC().send(peerAddress, broadcastBuilder,
                                        future.channelCreator(), broadcastBuilder);
                                LOG.debug("1st broadcast to {}", peerAddress);
                                Utils.addReleaseListener(future.channelCreator(), futureResponse);
                            } else {
View Full Code Here

                if (future.isSuccess()) {
                  FutureResponse[] futures = new FutureResponse[max];
                    for (int i = 0; i < max; i++) {
                        PeerAddress randomAddress = list.remove(rnd.nextInt(list.size()));
                       
                        BroadcastBuilder broadcastBuilder = new BroadcastBuilder(peer, messageKey);
                        broadcastBuilder.dataMap(dataMap);
                        broadcastBuilder.hopCounter(hopCounter + 1);
                        broadcastBuilder.udp(isUDP);
                       
                        futures[i] = peer.broadcastRPC().send(randomAddress,
                                broadcastBuilder, future.channelCreator(), broadcastBuilder);
                        LOG.debug("2nd broadcast to {}", randomAddress);
                    }
View Full Code Here

TOP

Related Classes of net.tomp2p.p2p.builder.BroadcastBuilder

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.