16#ifndef ERROR_DELIVERY_HPP_INCLUDED
17#define ERROR_DELIVERY_HPP_INCLUDED
22#include <system_error>
30#include "queue/wait_queue.hpp"
49 std::chrono::steady_clock::time_point time_p;
50 const void* io_intf_ptr;
53 error_data(
const void* iop, std::error_code e) :
54 time_p(std::chrono::steady_clock::now()), io_intf_ptr(iop), err(std::move(e)) { }
65template <
typename IOT>
68 wq.emplace_push(io.
get_ptr(), e);
91 auto elem = wq.wait_and_pop();
97 std::chrono::duration_cast<std::chrono::milliseconds>((*elem).time_p.time_since_epoch()).count();
99 os <<
'[' << t <<
"] io_addr: " << elem->io_intf_ptr <<
" err: " <<
100 elem->err <<
", " << (*elem).err.message() <<
'\n';
basic_io_interface class template, providing start_io, stop_io, visit_socket, make_io_output and rela...
The basic_io_interface class template provides access to an underlying network IO handler (TCP or UDP...
Definition basic_io_interface.hpp:100
const void * get_ptr() const noexcept
Return a raw pointer to an associated IO handler.
Definition basic_io_interface.hpp:581
std::size_t ostream_error_sink_with_wait_queue(err_wait_q &wq, std::ostream &os)
A sink function that uses a wait_queue for error data and streams the data into an std::ostream.
Definition error_delivery.hpp:88
auto make_error_func_with_wait_queue(err_wait_q &wq)
Create an error function object that uses a wait_queue for error data.
Definition error_delivery.hpp:66
chops::wait_queue< error_data > err_wait_q
wait_queue declaration that provides error data.
Definition error_delivery.hpp:60
Error codes, exception class, and error category within Chops net_ip library.
Data provided through an error function callback.
Definition error_delivery.hpp:48