diff --git a/gradle.properties b/gradle.properties index 337b92a..00cdcce 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ projectId = jnetperf projectGroup = biz.nellemann.jnetperf -projectVersion = 0.0.6 +projectVersion = 0.0.7 diff --git a/src/main/java/biz/nellemann/jnetperf/Application.java b/src/main/java/biz/nellemann/jnetperf/Application.java index f613750..c1137f0 100644 --- a/src/main/java/biz/nellemann/jnetperf/Application.java +++ b/src/main/java/biz/nellemann/jnetperf/Application.java @@ -54,12 +54,16 @@ public class Application implements Callable { @Override - public Integer call() throws Exception { + public Integer call() { - if(runMode.runServer) { - runServer(); - } else if(runMode.remoteServer != null) { - runClient(runMode.remoteServer); + try { + if (runMode.runServer) { + runServer(); + } else if (runMode.remoteServer != null) { + runClient(runMode.remoteServer); + } + } catch (IOException | InterruptedException e) { + System.err.println(e.getMessage()); } return 0; diff --git a/src/main/java/biz/nellemann/jnetperf/TcpServer.java b/src/main/java/biz/nellemann/jnetperf/TcpServer.java index d9558eb..7018b6f 100644 --- a/src/main/java/biz/nellemann/jnetperf/TcpServer.java +++ b/src/main/java/biz/nellemann/jnetperf/TcpServer.java @@ -22,7 +22,8 @@ public class TcpServer extends Thread { log.info("TcpServer()"); socket = new ServerSocket(port); - socket.setSoTimeout(10000); + socket.setSoTimeout(0); // Wait indefinitely + }