MCPcopy Create free account
hub / github.com/FastFlowLM/FastFlowLM / do_accept

Method do_accept

src/server/server.cpp:568–590  ·  view source on GitHub ↗

@brief do accept

Source from the content-addressed store, hash-verified

566
567///@brief do accept
568void WebServer::do_accept() {
569 acceptor.async_accept(
570 [this](beast::error_code ec, tcp::socket socket) {
571 if (!ec) {
572 // Check connection limit
573 if (active_connections_.load() >= max_connections_) {
574 header_print("LOG", "Connection limit reached (" + std::to_string(max_connections_) + "), rejecting new connection");
575 // Close the socket and continue accepting
576 socket.close();
577 } else {
578 // Increment connection counter
579 active_connections_.fetch_add(1);
580
581 // Create a new session for this connection
582 auto session = std::make_shared<HttpSession>(std::move(socket), *this);
583 session->start(cors);
584 }
585 }
586 if (running) {
587 do_accept();
588 }
589 });
590}
591
592///@brief process_next_npu_request Handles one queued NPU task at a time
593void WebServer::process_next_npu_request() {

Callers

nothing calls this directly

Calls 2

to_stringFunction · 0.50
startMethod · 0.45

Tested by

no test coverage detected