Random r = new Random();
final Peer peer;
try {
if (masterPeer != null) {
peer = new PeerMaker(new Number160(r)).setPorts(port)
.makeAndListen();
FutureBootstrap res = peer.bootstrap()
.setPeerAddress(masterPeer.getPeerAddress()).start();
res.awaitUninterruptibly();
} else
peer = new PeerMaker(new Number160(r)).setPorts(port)
.makeAndListen();
// Only if using the internet:
// peer.getConfiguration().setBehindFirewall(true);
} catch (java.net.BindException