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

Method OnReceiveMessage

library/cpp/neh/tcp2.cpp:1280–1301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1278 }
1279
1280 void OnReceiveMessage() {
1281 DBGOUT("OnReceiveMessage()");
1282 const TBaseHeader& hdr = Msg_.BaseHeader();
1283
1284 if (hdr.Type == TBaseHeader::Request) {
1285 TRequest* reqPtr = new TRequest(TConnectionRef(this), Msg_.Header(), Msg_.Content());
1286 IRequestRef req(reqPtr);
1287 ReqsState_[reqPtr->RequestHeader().Id] = reqPtr->State;
1288 OnRequest(req);
1289 } else if (hdr.Type == TBaseHeader::Cancel) {
1290 OnCancelRequest(hdr.Id);
1291 } else {
1292 throw yexception() << "unsupported message type: " << (ui32)hdr.Type;
1293 }
1294 Msg_.Clear();
1295 {
1296 TRequestId reqId;
1297 while (FinReqs_.Dequeue(&reqId)) {
1298 ReqsState_.erase(reqId);
1299 }
1300 }
1301 }
1302
1303 void OnRequest(IRequestRef& r) {
1304 DBGOUT("OnRequest()");

Callers

nothing calls this directly

Calls 5

yexceptionClass · 0.85
HeaderMethod · 0.45
ClearMethod · 0.45
DequeueMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected