net.tomp2p.examples
Class ExampleUtils
java.lang.Object
net.tomp2p.examples.ExampleUtils
public class ExampleUtils
- extends Object
This simple example creates 10 nodes, bootstraps to the first and put and get data from those 10 nodes.
- Author:
- draft
Method Summary |
static void |
bootstrap(Peer[] peers)
Bootstraps peers to the first peer in the array. |
static Peer[] |
createAndAttachNodes(int nr,
int port)
Create peers with a port and attach it to the first peer in the array. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExampleUtils
public ExampleUtils()
bootstrap
public static void bootstrap(Peer[] peers)
- Bootstraps peers to the first peer in the array.
- Parameters:
peers
- The peers that should be bootstrapped
createAndAttachNodes
public static Peer[] createAndAttachNodes(int nr,
int port)
throws IOException
- Create peers with a port and attach it to the first peer in the array.
- Parameters:
nr
- The number of peers to be createdport
- The port that all the peer listens to. The multiplexing is done via the peer Id
- Returns:
- The created peers
- Throws:
IOException
- IOException
Copyright © 2013. All Rights Reserved.