| 56 | } |
| 57 | |
| 58 | void NativeHttpServer::acceptClients() { |
| 59 | if (!mIsListening) { |
| 60 | return; |
| 61 | } |
| 62 | |
| 63 | // Accept new clients in a loop (non-blocking) |
| 64 | while (true) { |
| 65 | ServerClientConnection conn; |
| 66 | conn.clientId = mNextClientId; |
| 67 | conn.connection = HttpConnection(mConfig); |
| 68 | |
| 69 | asio::error_code ec = mAcceptor.accept(conn.socket); |
| 70 | if (ec) { |
| 71 | break; // No more clients to accept (would_block) or error |
| 72 | } |
| 73 | |
| 74 | conn.connection.onConnected(0); // Mark as connected immediately |
| 75 | mNextClientId++; |
| 76 | mClients.push_back(fl::move(conn)); |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | size_t NativeHttpServer::getClientCount() const { |
| 81 | return mClients.size(); |
nothing calls this directly
no test coverage detected