Chops Net IP
|
(Fill in details.)
Significant API and internal changes have been made.
basic_io_interface
is now split into basic_io_interface
and basic_io_output
. The send
and get_output_queue_stats
methods have moved from basic_io_interface
to basic_io_output
. There is now a make_io_output
method in basic_io_interface
. (Motivation: separation of responsibilities, allow optimized data sending path.)basic_net_entity
class. It is now net_entity
and is not a class template. (Motivation: simplify usage of net_entity
class.)basic_io_output
(either a tcp_io_output
or a udp_io_output
) instead of a basic_io_interface
. (Motivation: constrain possibilities within a message callback reply.)get_socket
is now visit_socket
with a different signature (now takes a function object instead of returning a socket reference). (Motivation: simplifies template method design.)net_entity
now has a visit_io_output
method to allow passing data into all available basic_io_output
objects associated with that net_entity
. (Motivation: consistency with visit_socket
and simplifies template method design.)io_interface.hpp
is now named io_type_decls.hpp
, which contains using
declarations to instantiate basic_io_interface
and basic_io_output
with tcp_io
and udp_io
. (Motivation: using
declarations are for two different class templates, both related to IO.)std::expected
return (currently using the nonstd
namespace instead of std
through Martin Moene's expected-lite
library). (Motivation: remove need for try
, catch
blocks, provide useful error return information.)Specifics on each change (including non-API changes):
basic_net_entity
has gone away, replaced by a non-template class supporting all three entity types (TCP connector, TCP acceptor, UDP). Internally it is now using a std::variant
.start_io
method is available for the basic_io_interface
class, supporting simple variable length message framing (a common use case).basic_io_interface
is now split into basic_io_interface
and basic_io_output
. This simplifies the responsibility of basic_io_interface
, as it now is (primarily) responsible only for starting and stopping IO. basic_io_output
is only responsible for sending data (and providing output queue statistics). This allows some optimization of the send path, since a weak_ptr
no longer has to be locked into a shared_ptr
for every send
. (This fits into the overall performance goal of making the sending and receiving of data to be as fast as possible, while other operations such as starting and stopping connections to have more overhead).basic_io_output
object instead of a basic_io_interface
object. This constrains the message handler callback, which is appropriate (since start_io
and stop_io
should never be called from within the message handler).net_entity
class now allows data to be passed into a visit_io_output
method (by function object), allowing that data (in the function object) to be sent to all associated and active IO handlers. This allows certain use cases to be simplified.send_to_all
and simple_variable_len_message_frame
component headers have been removed (now supported in the core library as described in the previous changes).net_ip_component
directory has been moved to net_ip_component
to make it more visible and to show that it is parallel to (and not part of) the core net_ip
library.Release 0.2 is now (Feb 25, 2018) merged to the master branch.
start
method function parameters of the basic_net_entity
class. There are two function object parameters for callbacks, the first is invoked on an IO state change, and the second is invoked on errors or closes. This makes better conceptual sense and cleans up former inconsistencies in the callback interface. Specifically:basic_io_interface
is associated to a valid IO handler. This allows for simpler state management and consistent associative container usage.basic_io_interface
object.basic_io_interface
and basic_net_entity
methods.All tests run, although they are still limited (see next steps and constraints).
Release 0.1 is now (Feb 13, 2018) merged to the master branch:
Known problems in release 0.1:
std::vector
resize
method on certain paths (where start_io
is called from a different thread where most of the processing is occurring). This is being actively worked.basic_net_entity.start
method (state change, error reporting callbacks). There are multiple possibilities, all of which have pros and cons. The message frame and message handler function object callback API is good and solid and is not likely to change.