|
Chops Net IP
|
Functions that create IO state change function objects used in the net_entity start method, each will invoke start_io.
More...
#include <cstddef>#include <utility>#include "asio/ip/udp.hpp"#include "net_ip/io_type_decls.hpp"#include "net_ip/simple_variable_len_msg_frame.hpp"

Go to the source code of this file.
Functions | |
| template<typename MH > | |
| auto | chops::net::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 for TCP reads. | |
| template<typename MH , typename MF > | |
| auto | chops::net::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 object, versus a simple variable len message frame. | |
| template<typename MH > | |
| auto | chops::net::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. | |
| template<typename MH , typename IOT = udp_io> | |
| auto | chops::net::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. | |
| template<typename IOT > | |
| auto | chops::net::make_send_only_io_state_change () |
| Create an IO state change function object with parameters for sending only, whether UDP or TCP. | |
| template<typename MH > | |
| auto | chops::net::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 destination endpoint. | |
| auto | chops::net::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 endpoint. | |
Functions that create IO state change function objects used in the net_entity start method, each will invoke start_io.
The common logic in each of these function objects is calling start_io on an io_interface after start has been called on a net_entity.
In general, there is a creation function corresponding to each overload of the start_io method of basic_io_interface.
Most of these functions are templated on the message handler class, which is different for every application.
net_ip core library, but are useful components for many applications.Copyright (c) 2018-2019 by Cliff Green
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
| auto chops::net::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 destination endpoint.
| endp | Default destination asio::ip::udp::endpoint. |
| max_size | Maximum buffer size for UDP reads. |
| msg_hdlr | A function object that can be used as a message handler in the start_io method. |
start method.| auto chops::net::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.
The IO state change function object created does not perform any actions on IO stop.
| delim | Delimiter for the TCP reads. |
| msg_hdlr | A function object that can be used as a message handler in the start_io method. |
start method.| auto chops::net::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 object, versus a simple variable len message frame.
| hdr_size | Size in bytes of message header. |
| msg_hdlr | A function object that can be used as a message handler in the start_io method. |
| msg_frame | A function object that can be used as a message frame in the start_io method. |
start method.| auto chops::net::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.
The IO type is defaulted to UDP, since fixed size TCP reads are a much less common use case.
| rd_size | Maximum buffer size for UDP reads or size of each TCP read. |
| msg_hdlr | A function object that can be used as a message handler in the start_io method. |
start method.
|
inline |
Create an IO state change function object parameters for UDP sending only with a default destination endpoint.
| endp | Default destination asio::ip::udp::endpoint. |
start method.| auto chops::net::make_send_only_io_state_change | ( | ) |
Create an IO state change function object with parameters for sending only, whether UDP or TCP.
start method. | auto chops::net::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 for TCP reads.
| hdr_size | Size in bytes of message header. |
| hdr_func | Header decoder function pointer, as described in hdr_decoder_func. |
| msg_hdlr | A function object that can be used as a message handler in the start_io method. |
start method.