Skip to content

Commit 913cf52

Browse files
authored
Update Main.java
1 parent 3dd79d0 commit 913cf52

File tree

1 file changed

+14
-14
lines changed
  • compiled_starters/java/src/main/java

1 file changed

+14
-14
lines changed

compiled_starters/java/src/main/java/Main.java

+14-14
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ public static void main(String[] args) {
77
// You can use print statements as follows for debugging, they'll be visible when running tests.
88
System.out.println("Logs from your program will appear here!");
99

10-
// Uncomment this block to pass the first stage
11-
//
12-
// try {
13-
// ServerSocket serverSocket = new ServerSocket(4221);
14-
//
15-
// // Since the tester restarts your program quite often, setting SO_REUSEADDR
16-
// // ensures that we don't run into 'Address already in use' errors
17-
// serverSocket.setReuseAddress(true);
18-
//
19-
// serverSocket.accept(); // Wait for connection from client.
20-
// System.out.println("accepted new connection");
21-
// } catch (IOException e) {
22-
// System.out.println("IOException: " + e.getMessage());
23-
// }
10+
Uncomment this block to pass the first stage
11+
12+
try {
13+
ServerSocket serverSocket = new ServerSocket(4221);
14+
15+
// Since the tester restarts your program quite often, setting SO_REUSEADDR
16+
// ensures that we don't run into 'Address already in use' errors
17+
serverSocket.setReuseAddress(true);
18+
19+
serverSocket.accept(); // Wait for connection from client.
20+
System.out.println("accepted new connection");
21+
} catch (IOException e) {
22+
System.out.println("IOException: " + e.getMessage());
23+
}
2424
}
2525
}

0 commit comments

Comments
 (0)