Wait indefinitely on server for connections.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Mark Nellemann 2023-07-14 08:15:15 +02:00
parent 9f67f98fec
commit 77b7984517
3 changed files with 12 additions and 7 deletions

View file

@ -1,3 +1,3 @@
projectId = jnetperf
projectGroup = biz.nellemann.jnetperf
projectVersion = 0.0.6
projectVersion = 0.0.7

View file

@ -54,12 +54,16 @@ public class Application implements Callable<Integer> {
@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;

View file

@ -22,7 +22,8 @@ public class TcpServer extends Thread {
log.info("TcpServer()");
socket = new ServerSocket(port);
socket.setSoTimeout(10000);
socket.setSoTimeout(0); // Wait indefinitely
}