32#ifndef IO_STATE_CHANGE_HPP_INCLUDED
33#define IO_STATE_CHANGE_HPP_INCLUDED
38#include "asio/ip/udp.hpp"
66 hdr_decoder_func hdr_func) {
67 return [hdr_size, hdr_func, mh = std::move(
msg_hdlr)]
68 (tcp_io_interface io, std::size_t num,
bool starting) {
70 io.start_io(hdr_size, std::move(mh), hdr_func);
92template <
typename MH,
typename MF>
96 return [hdr_size, mh = std::move(
msg_hdlr), mf = std::move(msg_frame)]
97 (tcp_io_interface io, std::size_t num,
bool starting) {
99 io.start_io(hdr_size, std::move(mh), std::move(mf));
119template <
typename MH>
121 return [delim, mh = std::move(
msg_hdlr)]
122 (tcp_io_interface io, std::size_t num,
bool starting) {
124 io.start_io(delim, std::move(mh));
145template <
typename MH,
typename IOT = udp_io>
147 return [rd_size, mh = std::move(
msg_hdlr)]
150 io.start_io(rd_size, std::move(mh));
162template <
typename IOT>
187template <
typename MH>
189 std::size_t max_size,
191 return [max_size, endp, mh = std::move(
msg_hdlr)]
192 (udp_io_interface io, std::size_t num,
bool starting) {
194 io.start_io(endp, max_size, std::move(mh));
211 return [endp] (udp_io_interface io, std::size_t num,
bool starting) {
The basic_io_interface class template provides access to an underlying network IO handler (TCP or UDP...
Definition basic_io_interface.hpp:100
auto start_io(std::size_t header_size, MH &&msg_handler, MF &&msg_frame) -> nonstd::expected< void, std::error_code >
Enable IO processing for the associated network IO handler with message frame logic.
Definition basic_io_interface.hpp:265
auto make_default_endp_io_state_change(const asio::ip::udp::endpoint &endp, std::size_t max_size, MH &&msg_hdlr)
Create an IO state change function object parameters for UDP senders and receivers with a default des...
Definition io_state_change.hpp:188
auto make_msg_frame_io_state_change(std::size_t hdr_size, MH &&msg_hdlr, MF &&msg_frame)
Create an IO state change function object that is fully templatized on the message frame function obj...
Definition io_state_change.hpp:93
auto make_send_only_default_endp_io_state_change(const asio::ip::udp::endpoint &endp)
Create an IO state change function object parameters for UDP sending only with a default destination ...
Definition io_state_change.hpp:210
auto make_send_only_io_state_change()
Create an IO state change function object with parameters for sending only, whether UDP or TCP.
Definition io_state_change.hpp:163
auto make_simple_variable_len_msg_frame_io_state_change(std::size_t hdr_size, MH &&msg_hdlr, hdr_decoder_func hdr_func)
Create an IO state change function object with a simple variable length message frame function object...
Definition io_state_change.hpp:64
auto make_delimiter_read_io_state_change(std::string_view delim, MH &&msg_hdlr)
Create an IO state change function object parameters for TCP delimited reads.
Definition io_state_change.hpp:120
auto make_read_io_state_change(std::size_t rd_size, MH &&msg_hdlr)
Create an IO state change function object with parameters for UDP reads or fixed size TCP reads.
Definition io_state_change.hpp:146
IO type declarations, relating to the basic_io_interface and basic_io_output class templates.
Function object class and declaration for simple variable length TCP message framing.
Definition tcp_dsr.cpp:96