docs: protected boolean isConnected(final Socket socket, final String host, final int port,
        final int timeoutInMs, final ErrorHandler errorHandler) {
      boolean isConnected;
      try {
        socket.connect(new InetSocketAddress(host, port), timeoutInMs);
        isConnected = socket.isConnected();
      } catch (IOException e) {
        isConnected = Boolean.FALSE;
      } finally {
        try {
          socket.close();
        } catch (IOException exception) {
          errorHandler.handleError(exception, "Could not close the socket");
        }
      }
      return isConnected;
    }