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

Method processIncomingConnections

src/OpenLoco/src/Network/NetworkServer.cpp:257–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255}
256
257void 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
276void NetworkServer::processPackets()
277{

Callers

nothing calls this directly

Calls 2

takeNextPacketMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected