Skip to content

Commit

Permalink
Wait indefinitely on server for connections.
Browse files Browse the repository at this point in the history
  • Loading branch information
mnellemann committed Jul 14, 2023
1 parent 9f67f98 commit 77b7984
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
projectId = jnetperf
projectGroup = biz.nellemann.jnetperf
projectVersion = 0.0.6
projectVersion = 0.0.7
14 changes: 9 additions & 5 deletions src/main/java/biz/nellemann/jnetperf/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,16 @@ static class RunMode {


@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;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/biz/nellemann/jnetperf/TcpServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public TcpServer(int port) throws IOException {
log.info("TcpServer()");

socket = new ServerSocket(port);
socket.setSoTimeout(10000);
socket.setSoTimeout(0); // Wait indefinitely

}


Expand Down

0 comments on commit 77b7984

Please sign in to comment.