| 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(); |
no test coverage detected