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

Method TServer

library/cpp/neh/tcp2.cpp:1495–1510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1493 //////////// TServer /////////
1494 public:
1495 TServer(IOnRequest* cb, ui16 port)
1496 : EP_(TTcp2Options::AsioServerThreads)
1497 , CB_(cb)
1498 {
1499 TNetworkAddress addr(port);
1500
1501 for (TNetworkAddress::TIterator it = addr.Begin(); it != addr.End(); ++it) {
1502 TEndpoint ep(new NAddr::TAddrInfo(&*it));
1503 TTcpAcceptorPtr a(new TTcpAcceptor(EA_.GetIOService()));
1504 //DBGOUT("bind:" << ep.IpToString() << ":" << ep.Port());
1505 a->Bind(ep);
1506 a->Listen(TTcp2Options::Backlog);
1507 StartAccept(a.Get());
1508 A_.push_back(a);
1509 }
1510 }
1511
1512 ~TServer() override {
1513 EA_.SyncShutdown(); //cancel accepting connections

Callers

nothing calls this directly

Calls 6

BeginMethod · 0.45
EndMethod · 0.45
BindMethod · 0.45
ListenMethod · 0.45
GetMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected