Network System 0.1.1
High-performance modular networking library for scalable client-server applications
Loading...
Searching...
No Matches
kcenon::network::concepts::MetricsAwareSocket Concept Reference

Concept for sockets with runtime metrics. More...

#include <socket_concepts.h>

Concept definition

template<typename T>
concept kcenon::network::concepts::MetricsAwareSocket = requires(T& socket, const T& const_socket) {
{ const_socket.metrics() };
{ socket.reset_metrics() } -> std::same_as<void>;
}
Concept for sockets with runtime metrics.

Detailed Description

Concept for sockets with runtime metrics.

Sockets satisfying this concept provide monitoring capabilities for performance analysis and debugging.

Example usage:

template<MetricsAwareSocket S>
void log_stats(const S& socket) {
const auto& m = socket.metrics();
std::cout << "Bytes sent: " << m.total_bytes_sent << std::endl;
}

Definition at line 300 of file socket_concepts.h.