Here is a fragment of code. We skipped some lines to simplify it:
try (ServerSocket server = new ServerSocket(PORT)) {
while (true) {
try (
Socket socket = server.accept(); // accept a new client
DataOutputStream output = new DataOutputStream(socket.getOutputStream())
) {
output.writeUTF("Hello!"); // send a message to the client
}
}
} catch (IOException e) {
e.printStackTrace();
}Describe this code by selecting all applicable statements.