diff --git a/bin/build-launcher.sh b/bin/build-launcher.sh index 71ac1d1..f38549a 100755 --- a/bin/build-launcher.sh +++ b/bin/build-launcher.sh @@ -2,7 +2,7 @@ basedir=$(dirname $(dirname $(readlink -fm $0))) -# convert the jar files from an existing I2P built into modules suitable for use with jlink +# convert the jar files from an existing I2P build into modules suitable for use with jlink $basedir/bin/convert-jars-to-modules.sh # compile the Main class that starts the I2P router and SAM listener diff --git a/src/org/getmonero/i2p/embedded/Main.java b/src/org/getmonero/i2p/embedded/Main.java index 261ae51..4056663 100644 --- a/src/org/getmonero/i2p/embedded/Main.java +++ b/src/org/getmonero/i2p/embedded/Main.java @@ -21,6 +21,7 @@ public class Main { p.put("i2p.dir.base", "/usr/share/i2p"); // where to find the I2P data files p.put("i2p.dir.config", System.getProperty("user.home") + File.separator + ".i2p"); + // bandwidth limits in K bytes per second p.put("i2np.inboundKBytesPerSecond","50"); p.put("i2np.outboundKBytesPerSecond","50"); @@ -32,7 +33,7 @@ public class Main { @Override public void run() { // don't call exit() when the router stops - r.setKillVMOnEnd(false); + r.setKillVMOnEnd(true); r.runRouter(); } }.start(); @@ -41,6 +42,17 @@ public class Main { @Override public void run() { try { + + while(true) { + if(r.isAlive()) { + break; + } + else { + Thread.sleep(1000); + System.out.println("Waiting for I2P router to start..."); + } + } + String[] args = new String[]{"sam.keys", "127.0.0.1", "7656", "i2cp.tcp.host=127.0.0.1", "i2cp.tcp.port=7654"}; I2PAppContext context = r.getContext(); ClientAppManager mgr = new ClientAppManagerImpl(context);