Package

Source Code of APITest

import dijjer.api.JavaAPI;
import dijjer.io.comm.Peer;
import dijjer.io.comm.RoutingTable.PeerInfo;

public class APITest {

  public static final String VERSION = "$Id: APITest.java,v 1.3 2005/04/12 13:04:15 sanity Exp $";

  public static void main(String[] args) throws Exception {
    JavaAPI api = new JavaAPI();
    api.start(new String[] {"seednode=none"});
    Thread.sleep(20000); //manually start another peer here if you want
    Peer[] peers = api.getConnectedPeers();
    System.out.println("peers = " + peers.length);
    for (int i = 0; i < peers.length; i++) {
      Peer peer = peers[i];
      System.out.println("peer = " + peer);
      PeerInfo info = api.getPeerInfo(peer);
      System.out.println("info = " + info);
    }
  }

}
TOP

Related Classes of APITest

TOP
Copyright © 2018 www.massapi.com. 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.