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

Method TNehRequester

library/cpp/par/par_network.cpp:57–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55 };
56
57 explicit TNehRequester(
58 int port,
59 TProcessQueryCancelCallback queryCancelCallback,
60 TProcessQueryCallback queryCallback,
61 TProcessReplyCallback replyCallback)
62 : QueryCancelCallback(std::move(queryCancelCallback))
63 , QueryCallback(std::move(queryCallback))
64 , ReplyCallback(std::move(replyCallback))
65 {
66 NNeh::SetProtocolOption("tcp2/ServerOutputDeadline", "600s");
67 MultiClient = NNeh::CreateMultiClient();
68 MultiClientThread = SystemThreadFactory()->Run([this]() {
69 MultiClientThreadLoopFunction();
70 });
71 ReceiverServices = NNeh::CreateLoop();
72 if (port == 0) {
73 ListenPort = GetFreeTcpPort();
74 } else {
75 ListenPort = port;
76 }
77 TNetworkAddress serverAddr("*", ListenPort);
78 PAR_DEBUG_LOG << "Listening as " << serverAddr.GetNehAddr() << Endl;
79 ReceiverServices->Add(serverAddr.GetNehAddr(), [this](const NNeh::IRequestRef& req) {
80 NehServiceQueryCallback(req);
81 });
82 ReceiverServices->ForkLoop(5);
83 PingerThread = SystemThreadFactory()->Run([this]() {
84 PingerThreadFunction();
85 });
86 }
87
88 int GetListenPort() const override {
89 return ListenPort;

Callers

nothing calls this directly

Calls 5

SystemThreadFactoryFunction · 0.85
moveFunction · 0.50
RunMethod · 0.45
AddMethod · 0.45
ForkLoopMethod · 0.45

Tested by

no test coverage detected