Skip to content

Commit 2b5a064

Browse files
Dao NgocDao Ngoc
authored andcommitted
Close server immediately after accepting the connection we need
1 parent 97f52af commit 2b5a064

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

agent/src/main/java/scalive/Agent.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,10 @@ public static void agentmain(String agentArgs, Instrumentation inst) throws IOEx
4545
public void run() {
4646
try {
4747
Socket client = server.accept(); // Block until a connection comes in
48+
server.close(); // Accept no other clients
4849
Server.serve(client, jarpath, clId);
4950
} catch (Exception e) {
5051
e.printStackTrace();
51-
} finally {
52-
try {
53-
server.close();
54-
} catch (Exception e) {
55-
e.printStackTrace();
56-
}
5752
}
5853
}
5954
}).start();

0 commit comments

Comments
 (0)