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

Method THttpServer

library/cpp/neh/http2.cpp:1868–1886  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1866
1867 public:
1868 THttpServer(IOnRequest* cb, const TParsedLocation& loc)
1869 : E_(THttp2Options::AsioServerThreads)
1870 , CB_(cb)
1871 , LimitRequestsPerConnection(THttp2Options::LimitRequestsPerConnection)
1872 {
1873 TNetworkAddress addr = THttp2Options::RespectHostInHttpServerNetworkAddress ?
1874 TNetworkAddress(TString(loc.Host), loc.GetPort())
1875 : TNetworkAddress(loc.GetPort());
1876
1877 for (TNetworkAddress::TIterator it = addr.Begin(); it != addr.End(); ++it) {
1878 TEndpoint ep(new NAddr::TAddrInfo(&*it));
1879 TTcpAcceptorPtr a(new TTcpAcceptor(AcceptExecutor_.GetIOService()));
1880 DBGOUT("bind:" << ep.IpToString() << ":" << ep.Port());
1881 a->Bind(ep);
1882 a->Listen(THttp2Options::Backlog);
1883 StartAccept(a.Get());
1884 A_.push_back(a);
1885 }
1886 }
1887
1888 ~THttpServer() override {
1889 AcceptExecutor_.SyncShutdown(); //cancel operation for all current sockets (include acceptors)

Callers

nothing calls this directly

Calls 10

IpToStringMethod · 0.80
TNetworkAddressClass · 0.50
GetPortMethod · 0.45
BeginMethod · 0.45
EndMethod · 0.45
PortMethod · 0.45
BindMethod · 0.45
ListenMethod · 0.45
GetMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected