Package net.tomp2p.p2p

Examples of net.tomp2p.p2p.DefaultBroadcastHandler


      PeerDHT[] peers = UtilsDHT2.createNodes(1000, rnd, 4001);
      master = peers[0];
      UtilsDHT2.perfectRouting(peers);
      // do testing
      master.peer().broadcast(Number160.createHash("blub")).udp(false).start();
      DefaultBroadcastHandler d = (DefaultBroadcastHandler) master.peer().broadcastRPC().broadcastHandler();
      int counter = 0;
      while (d.getBroadcastCounter() < 900) {
        Thread.sleep(200);
        counter++;
        if (counter > 100) {
          System.err.println("did not broadcast to 1000 peers, but to " + d.getBroadcastCounter());
          Assert.fail("did not broadcast to 1000 peers, but to " + d.getBroadcastCounter());
        }
      }
      System.err.println("DONE");
    } finally {
      if (master != null) {
View Full Code Here

TOP

Related Classes of net.tomp2p.p2p.DefaultBroadcastHandler

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.