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

Function GetDebugInfo

library/cpp/netliba/v12/udp_http.cpp:1429–1463  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1427 }
1428
1429 TString GetDebugInfo(const TUdpAddress& addr, double timeout) {
1430 NHPTimer::STime start;
1431 NHPTimer::GetTime(&start);
1432 TIntrusivePtr<IUdpHost> host = CreateUdpHost(0);
1433 if (!host) {
1434 fprintf(stderr, "CreateUdpHost failed!\n");
1435 return TString();
1436 }
1437
1438 TIntrusivePtr<IConnection> connection = host->Connect(addr, TConnectionSettings());
1439 {
1440 TAutoPtr<TRopeDataPacket> rq = new TRopeDataPacket;
1441 rq->Write((char)PKT_GETDEBUGINFO);
1442 host->Send(connection, rq.Release(), PP_HIGH, TTos(), DEFAULT_NETLIBA_COLOR);
1443 }
1444 for (;;) {
1445 TAutoPtr<TUdpRequest> ptr = host->GetRequest();
1446 if (ptr.Get()) {
1447 TBlockChainIterator reqData(ptr->Data->GetChain());
1448 int sz = reqData.GetSize();
1449 TString res;
1450 res.resize(sz);
1451 reqData.Read(res.begin(), sz);
1452 return res;
1453 }
1454 host->Step();
1455 host->Wait(0.1f);
1456
1457 NHPTimer::STime now;
1458 NHPTimer::GetTime(&now);
1459 if (NHPTimer::GetSeconds(now - start) > timeout) {
1460 return TString();
1461 }
1462 }
1463 }
1464
1465 void StopAllNetLibaThreads() {
1466 AtomicSwap(&PanicAttack, 1); // AAAA!!!!

Callers

nothing calls this directly

Calls 15

TConnectionSettingsClass · 0.85
TTosClass · 0.85
CreateUdpHostFunction · 0.70
ConnectMethod · 0.45
WriteMethod · 0.45
SendMethod · 0.45
ReleaseMethod · 0.45
GetRequestMethod · 0.45
GetMethod · 0.45
GetSizeMethod · 0.45
resizeMethod · 0.45
ReadMethod · 0.45

Tested by

no test coverage detected