MCPcopy Create free account
hub / github.com/catboost/catboost / WaitUntilConnectable

Function WaitUntilConnectable

library/cpp/coroutine/engine/helper.cpp:23–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21 }
22
23 bool WaitUntilConnectable(const TString& host, ui16 port, TDuration timeout) {
24 const TInstant deadline = timeout.ToDeadLine();
25
26 for (size_t i = 1; Now() < deadline; ++i) {
27 const TDuration waitTime = TDuration::MilliSeconds(100) * i * i;
28 SleepUntil(Min(Now() + waitTime, deadline));
29
30 if (TryConnect(host, port, waitTime)) {
31 return true;
32 }
33 }
34
35 return false;
36 }
37}

Callers

nothing calls this directly

Calls 6

MilliSecondsFunction · 0.85
SleepUntilFunction · 0.85
TryConnectFunction · 0.85
ToDeadLineMethod · 0.80
NowFunction · 0.50
MinFunction · 0.50

Tested by

no test coverage detected