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

Method ReceiveLoopFunc

library/cpp/par/par_network.cpp:412–437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410
411 private:
412 void ReceiveLoopFunc() {
413 while (!Stopped) {
414 THolder<NNetliba_v12::TUdpHttpRequest> nlReq(Requester->GetRequest());
415 if (nlReq) {
416 QuickLZDecompress(&nlReq->Data);
417 PAR_DEBUG_LOG << "Got request " << nlReq->Url.data() << Endl;
418 TAutoPtr<TNetworkRequest> netReq = new TNetworkRequest;
419 netReq->ReqId = nlReq->ReqId;
420 netReq->Url = nlReq->Url;
421 netReq->Data = std::move(nlReq->Data);
422 QueryCallback(netReq);
423 }
424 TAutoPtr<NNetliba_v12::TUdpHttpResponse> answer = Requester->GetResponse();
425 if (answer) {
426 TAutoPtr<TNetworkResponse> response = new TNetworkResponse;
427 ProcessUdpHttpResponse(answer, response);
428
429 ReplyCallback(response);
430 }
431 TGUID canceledReq;
432 if (Requester->GetRequestCancel(&canceledReq)) {
433 QueryCancelCallback(canceledReq);
434 }
435 Requester->GetAsyncEvent().Wait();
436 }
437 }
438
439 void ProcessUdpHttpResponse(TAutoPtr<NNetliba_v12::TUdpHttpResponse>& answer, TAutoPtr<TNetworkResponse>& response) {
440 NNetliba_v12::AbortOnFailedRequest(answer.Get()); //LEGACY

Callers

nothing calls this directly

Calls 7

QuickLZDecompressFunction · 0.85
moveFunction · 0.50
GetRequestMethod · 0.45
dataMethod · 0.45
GetResponseMethod · 0.45
GetRequestCancelMethod · 0.45
WaitMethod · 0.45

Tested by

no test coverage detected