MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / removedTimedOutClients

Method removedTimedOutClients

src/OpenLoco/src/Network/NetworkServer.cpp:197–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197void NetworkServer::removedTimedOutClients()
198{
199 for (auto it = _clients.begin(); it != _clients.end();)
200 {
201 auto& client = *it;
202 if (client->connection->hasTimedOut())
203 {
204 Logging::info("Client timed out: %s", client->name);
205 it = _clients.erase(it);
206 }
207 else
208 {
209 it++;
210 }
211 }
212
213 _clients.erase(
214 std::remove_if(_clients.begin(), _clients.end(), [](const std::unique_ptr<Client>& client) { return client->connection->hasTimedOut(); }), _clients.end());
215}
216
217void NetworkServer::sendPings()
218{

Callers

nothing calls this directly

Calls 4

infoFunction · 0.85
beginMethod · 0.45
endMethod · 0.45
hasTimedOutMethod · 0.45

Tested by

no test coverage detected