public void AwaitConnected()

in JetBrains.Profiler.SelfApi/src/Impl/ConsoleProfiler.cs [206:224]


    public void AwaitConnected(int milliseconds)
    {
      if(_isApiReady == null)
        return;

      var stopwatch = new Stopwatch();
      stopwatch.Start();

      while (!_isApiReady())
      {
        if (_process.HasExited)
          throw BuildException($"{_presentableName} has exited unexpectedly. See details below.");

        if (!IsInfiniteTimeout(milliseconds) && stopwatch.ElapsedMilliseconds > milliseconds)
          throw BuildException($"Profiler.Api was not ready in given time ({milliseconds} ms). Try increasing the profiler response timeout using UseCustomResponseTimeout.");

        Thread.Sleep(40);
      }
    }