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

Method OnReceiveMessage

library/cpp/neh/tcp2.cpp:996–1013  ·  view source on GitHub ↗

must be called only from asio thread

Source from the content-addressed store, hash-verified

994
995 //must be called only from asio thread
996 void OnReceiveMessage() {
997 //DBGOUT("OnReceiveMessage");
998 const TBaseHeader& hdr = Msg_.BaseHeader();
999
1000 if (hdr.Type == TBaseHeader::Response) {
1001 ProcessReqsInFlyQueue();
1002 TReqsInFly::iterator it = ReqsInFly_.find(hdr.Id);
1003 if (it == ReqsInFly_.end()) {
1004 DBGOUT("ignore response: " << hdr.Id);
1005 return;
1006 }
1007
1008 it->second->OnResponse(Msg_);
1009 ReqsInFly_.erase(it);
1010 } else {
1011 throw yexception() << TStringBuf("unsupported message type: ") << hdr.Type;
1012 }
1013 }
1014
1015 TRequestId LastSendedRequestId() const noexcept {
1016 return LastSendedReqId_.load(std::memory_order_acquire);

Callers

nothing calls this directly

Calls 5

yexceptionClass · 0.85
findMethod · 0.45
endMethod · 0.45
OnResponseMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected