Skip to content

Commit

Permalink
Only one ServerSocket.accept() in parallel !
Browse files Browse the repository at this point in the history
Issue #504
  • Loading branch information
gquerret committed Mar 24, 2023
1 parent f917425 commit 0cfe758
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/java/com/phenix/pct/PCTBgRun.java
Original file line number Diff line number Diff line change
Expand Up @@ -662,14 +662,15 @@ public int getLocalPort() {
public void run() {
ExecutorService group = Executors.newFixedThreadPool(numThreads);
for (int zz = 0; zz < numThreads; zz++) {
final Socket socket;
try {
socket = server.accept();
} catch (IOException caught) {
setBuildException(caught);
return;
}

group.execute(() -> {
final Socket socket;
try {
socket = server.accept();
} catch (IOException caught) {
setBuildException(caught);
return;
}
final BackgroundWorker status = createOpenEdgeWorker(socket);
status.setDBConnections(options.getDBConnections().iterator());
status.setAliases(options.getAliases().iterator());
Expand Down

0 comments on commit 0cfe758

Please sign in to comment.