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

Method AddRequestFromSocket

library/cpp/http/server/http.cpp:180–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178 }
179
180 void AddRequestFromSocket(const TSocket& s, TInstant now, NAddr::IRemoteAddrRef listenerSockAddrRef) {
181 if (MaxRequestsReached()) {
182 Cb_->OnMaxConn();
183 bool wasRemoved = Connections->RemoveOld(TInstant::Max());
184 if (!wasRemoved && Options_.RejectExcessConnections) {
185 (new TClientConnection(s, this, listenerSockAddrRef))->Reject();
186 return;
187 }
188 }
189
190 auto connection = new TClientConnection(s, this, listenerSockAddrRef);
191 connection->LastUsed = now;
192 connection->DeActivate();
193 }
194
195 void SaveErrorCode() {
196 ErrorCode = WSAGetLastError();

Callers 1

OnPollEventMethod · 0.80

Calls 5

OnMaxConnMethod · 0.80
RemoveOldMethod · 0.80
RejectMethod · 0.80
DeActivateMethod · 0.80
MaxFunction · 0.50

Tested by

no test coverage detected