Separate phases for processing existing and new connections

This commit is contained in:
2025-08-21 11:58:10 -04:00
parent 78a7549ce5
commit cfddaddb31
2 changed files with 115 additions and 163 deletions

View File

@@ -4,6 +4,7 @@
#include "connection_handler.hpp"
#include <atomic>
#include <memory>
#include <span>
#include <thread>
#include <vector>
@@ -117,7 +118,11 @@ private:
void cleanup_resources();
// Helper for processing connection I/O
bool process_connection_io(std::unique_ptr<Connection> &conn, int events);
void process_connection_io(std::unique_ptr<Connection> &conn, int events);
// Helper for processing a batch of connections with their events
void process_connection_batch(std::span<std::unique_ptr<Connection>> batch,
std::span<const int> events, bool is_new);
/**
* Called internally to return ownership to the server.
@@ -134,4 +139,4 @@ private:
Server &operator=(const Server &) = delete;
Server(Server &&) = delete;
Server &operator=(Server &&) = delete;
};
};