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

Function GetDebugInfo

library/cpp/netliba/v6/udp_http.cpp:1279–1308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1277 }
1278
1279 TString GetDebugInfo(const TUdpAddress& addr, double timeout) {
1280 NHPTimer::STime start;
1281 NHPTimer::GetTime(&start);
1282 TIntrusivePtr<IUdpHost> host = CreateUdpHost(0);
1283 {
1284 TAutoPtr<TRopeDataPacket> rq = new TRopeDataPacket;
1285 rq->Write((char)PKT_GETDEBUGINFO);
1286 ui32 crc32 = CalcChecksum(rq->GetChain());
1287 host->Send(addr, rq.Release(), crc32, nullptr, PP_HIGH);
1288 }
1289 for (;;) {
1290 TAutoPtr<TRequest> ptr = host->GetRequest();
1291 if (ptr.Get()) {
1292 TBlockChainIterator reqData(ptr->Data->GetChain());
1293 int sz = reqData.GetSize();
1294 TString res;
1295 res.resize(sz);
1296 reqData.Read(res.begin(), sz);
1297 return res;
1298 }
1299 host->Step();
1300 host->Wait(0.1f);
1301
1302 NHPTimer::STime now;
1303 NHPTimer::GetTime(&now);
1304 if (NHPTimer::GetSeconds(now - start) > timeout) {
1305 return TString();
1306 }
1307 }
1308 }
1309
1310 void Kill(const TUdpAddress& addr) {
1311 TIntrusivePtr<IUdpHost> host = CreateUdpHost(0);

Callers

nothing calls this directly

Calls 13

CreateUdpHostFunction · 0.70
CalcChecksumFunction · 0.70
WriteMethod · 0.45
SendMethod · 0.45
ReleaseMethod · 0.45
GetRequestMethod · 0.45
GetMethod · 0.45
GetSizeMethod · 0.45
resizeMethod · 0.45
ReadMethod · 0.45
beginMethod · 0.45
StepMethod · 0.45

Tested by

no test coverage detected