Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ Closeable bind(int port) {
}

boolean canBind(int port) {
try {
ServerSocket socket = new ServerSocket(port);
socket.close();
try (ServerSocket socket = new ServerSocket(port)) {
return true;
} catch (IOException exception) {
return false;
Expand Down