Network System 0.1.1
High-performance modular networking library for scalable client-server applications
Loading...
Searching...
No Matches
rate_limiter.h File Reference

Rate limiting and connection limiting for DoS prevention. More...

#include <chrono>
#include <mutex>
#include <shared_mutex>
#include <unordered_map>
#include <string>
#include <string_view>
#include <atomic>
#include <cstddef>
#include <cstdint>
Include dependency graph for rate_limiter.h:

Go to the source code of this file.

Classes

struct  kcenon::network::rate_limiter_config
 Configuration for rate limiter. More...
 
class  kcenon::network::rate_limiter
 Token bucket rate limiter. More...
 
struct  kcenon::network::rate_limiter::bucket
 
class  kcenon::network::connection_limiter
 Connection count limiter. More...
 
class  kcenon::network::connection_guard
 RAII guard for connection limiting. More...
 
class  kcenon::network::per_client_connection_limiter
 Per-client connection limiter. More...
 

Namespaces

namespace  kcenon
 
namespace  kcenon::network
 Main namespace for all Network System components.
 

Detailed Description

Rate limiting and connection limiting for DoS prevention.

Provides token bucket rate limiting and connection count limiting to prevent denial-of-service attacks.

Features:

  • Token bucket rate limiting per client
  • Connection count limiting
  • Thread-safe implementation
  • Configurable limits
  • Automatic cleanup of stale entries

Definition in file rate_limiter.h.