| 255 | } |
| 256 | |
| 257 | void NetworkServer::processIncomingConnections() |
| 258 | { |
| 259 | std::unique_lock<std::mutex> lk(_incomingConnectionsSync); |
| 260 | for (auto& conn : _incomingConnections) |
| 261 | { |
| 262 | // The connect packet should be the first one |
| 263 | while (auto packet = conn->takeNextPacket()) |
| 264 | { |
| 265 | if (auto connectPacket = packet->as<PacketKind::connect, ConnectPacket>()) |
| 266 | { |
| 267 | createNewClient(std::move(conn), *connectPacket); |
| 268 | break; |
| 269 | } |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | _incomingConnections.clear(); |
| 274 | } |
| 275 | |
| 276 | void NetworkServer::processPackets() |
| 277 | { |
nothing calls this directly
no test coverage detected