Skip to content

Instantly share code, notes, and snippets.

public class TomP2PMessageTest {
@Test
public void testMessaging() throws IOException, InterruptedException {
Peer peer = new PeerMaker( Number160.ONE ).setPorts( 4000 ).makeAndListen();
int numberOfItems = 10000;
final CountDownLatch latch = new CountDownLatch( numberOfItems );
peer.setObjectDataReply( new ObjectDataReply() {
@Override
public Object reply( PeerAddress sender, Object request ) throws Exception {