MCPcopy Create free account
hub / github.com/FastLED/FastLED / acceptClients

Method acceptClients

src/fl/stl/asio/http/native_server.cpp.hpp:58–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58void 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
80size_t NativeHttpServer::getClientCount() const {
81 return mClients.size();

Callers

nothing calls this directly

Calls 4

HttpConnectionClass · 0.85
onConnectedMethod · 0.80
acceptMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected