private @NotNull Socket createSocket() throws IOException {
    InetAddress host = myHost;
    if (host == null) {
      try {
        host = InetAddress.getLocalHost();
      }
      catch (UnknownHostException ignored) {
        host = InetAddress.getLoopbackAddress();
      }
    }

    IOException exc = null;
    for (int i = 0; i < myPortsNumberToTry; i++) {
      int port = myInitialPort + i;
      try {
        return new Socket(host, port);
      }
      catch (IOException e) {
        exc = e;
        LOG.debug(e);
      }
    }
    throw exc;
  }
private @NotNull Socket createSocket()