|
Network System 0.1.1
High-performance modular networking library for scalable client-server applications
|
A client class demonstrating concept-constrained callbacks. More...

Public Member Functions | |
| template<DataReceiveHandler Handler> | |
| void | on_data (Handler &&handler) |
| Set data receive handler. | |
| template<ErrorHandler Handler> | |
| void | on_error (Handler &&handler) |
| Set error handler. | |
| template<ConnectionHandler Handler> | |
| void | on_connect (Handler &&handler) |
| Set connection handler. | |
| template<RetryCallback Handler> | |
| void | on_retry (Handler &&handler) |
| Set retry callback. | |
| void | simulate_events () |
Private Attributes | |
| std::function< void(const std::vector< uint8_t > &)> | data_handler_ |
| std::function< void(std::error_code)> | error_handler_ |
| std::function< void()> | connect_handler_ |
| std::function< void(std::size_t)> | retry_handler_ |
A client class demonstrating concept-constrained callbacks.
Definition at line 105 of file concepts_example.cpp.
|
inline |
Set connection handler.
| Handler | Must be callable with no arguments |
Definition at line 132 of file concepts_example.cpp.
References connect_handler_.
|
inline |
Set data receive handler.
| Handler | Must be callable with const std::vector<uint8_t>& |
Definition at line 112 of file concepts_example.cpp.
References data_handler_.
|
inline |
Set error handler.
| Handler | Must be callable with std::error_code |
Definition at line 122 of file concepts_example.cpp.
References error_handler_.
|
inline |
Set retry callback.
| Handler | Must be callable with std::size_t (attempt number) |
Definition at line 142 of file concepts_example.cpp.
References retry_handler_.
|
inline |
Definition at line 148 of file concepts_example.cpp.
References connect_handler_, data_handler_, error_handler_, and retry_handler_.
|
private |
Definition at line 176 of file concepts_example.cpp.
Referenced by on_connect(), and simulate_events().
|
private |
Definition at line 174 of file concepts_example.cpp.
Referenced by on_data(), and simulate_events().
|
private |
Definition at line 175 of file concepts_example.cpp.
Referenced by on_error(), and simulate_events().
|
private |
Definition at line 177 of file concepts_example.cpp.
Referenced by on_retry(), and simulate_events().