🚀 Context & Motivation
To evolve toolB from a raw concurrent server into a comprehensive Middleware Kernel, we need to implement complex state management features (Rate Limiting maps, Auth caches) and a more robust I/O model (Reactor Pattern/Epoll).
While C is performant, it lacks the standard containers and RAII (Resource Acquisition Is Initialization) semantics required to implement these features safely and maintainably. We are migrating the heartware_server to Systems C++ (C++17).
This is not a move to heavy object-oriented programming. We will adhere to a "Flat C++" style:
Using std:: containers for internal state.
Using RAII for resource management (Sockets, FD closure).
Keeping the Shared Memory boundary strictly C-compatible (POD types).
🎯 Objectives
-
Enable Complex State: Allow usage of std::unordered_map for O(1) IP tracking and Rate Limiting.
-
Safety & Cleanup: Replace manual close()/free() calls with RAII wrappers to prevent file descriptor leaks in the future Event Loop.
-
Prepare for Reactor: Establish the foundation for the transition from "Thread-per-Connection" to "Epoll/Event Loop".
🛠 Implementation Tasks
🚀 Context & Motivation
To evolve toolB from a raw concurrent server into a comprehensive Middleware Kernel, we need to implement complex state management features (Rate Limiting maps, Auth caches) and a more robust I/O model (Reactor Pattern/Epoll).
While C is performant, it lacks the standard containers and RAII (Resource Acquisition Is Initialization) semantics required to implement these features safely and maintainably. We are migrating the heartware_server to Systems C++ (C++17).
This is not a move to heavy object-oriented programming. We will adhere to a "Flat C++" style:
Using std:: containers for internal state.
Using RAII for resource management (Sockets, FD closure).
Keeping the Shared Memory boundary strictly C-compatible (POD types).
🎯 Objectives
Enable Complex State: Allow usage of std::unordered_map for O(1) IP tracking and Rate Limiting.
Safety & Cleanup: Replace manual close()/free() calls with RAII wrappers to prevent file descriptor leaks in the future Event Loop.
Prepare for Reactor: Establish the foundation for the transition from "Thread-per-Connection" to "Epoll/Event Loop".
🛠 Implementation Tasks