| 195 | } |
| 196 | |
| 197 | void 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 | |
| 217 | void NetworkServer::sendPings() |
| 218 | { |
nothing calls this directly
no test coverage detected