Wait indefinitely on server for connections.
continuous-integration/drone/push Build is passing Details

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 projectId = jnetperf
projectGroup = biz.nellemann.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 @Override
public Integer call() throws Exception { public Integer call() {
if(runMode.runServer) { try {
runServer(); if (runMode.runServer) {
} else if(runMode.remoteServer != null) { runServer();
runClient(runMode.remoteServer); } else if (runMode.remoteServer != null) {
runClient(runMode.remoteServer);
}
} catch (IOException | InterruptedException e) {
System.err.println(e.getMessage());
} }
return 0; return 0;

View File

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