diff --git a/net/adc_device_netserver.h b/net/adc_device_netserver.h index f23373e..737cc57 100644 --- a/net/adc_device_netserver.h +++ b/net/adc_device_netserver.h @@ -237,7 +237,7 @@ public: auto self(this->shared_from_this()); _netService.asyncReceive( - [self, this](std::error_code ec, message_t msg) { + [self, this](netservice_t::async_callback_err_t ec, message_t msg) { if (ec) { stop(); } else { @@ -249,7 +249,7 @@ public: _netService.asyncSend( *msg_sptr, - [self, msg_sptr, this](std::error_code ec) { + [self, msg_sptr, this](netservice_t::async_callback_err_t ec) { if (ec) { stop(); } else { diff --git a/net/adc_net_concepts.h b/net/adc_net_concepts.h index 8fbd3e3..e42721b 100644 --- a/net/adc_net_concepts.h +++ b/net/adc_net_concepts.h @@ -47,7 +47,7 @@ using adc_common_duration_t = adc_duration_common_type_t; -// concepts for asynchronous opereration callback callable first argument type (asynchronous operation error) +// concepts for asynchronous operation callback callable first argument type (asynchronous operation error) // 1) the type must be convertible to boolean and // a) true - asynchronous operation completed without errors // b) false - an error occured @@ -106,6 +106,9 @@ concept adc_netservice_c = requires(SRVT srv, const SRVT srv_const) { typename SRVT::endpoint_t; // a type representing endpoint of the network service // underlying protocol + // asynchronous operation error + requires adc_async_callback_err_t; + // callback callables for asynchronous operations requires adc_async_callback_t; requires adc_async_callback_t; diff --git a/net/adc_netserver.h b/net/adc_netserver.h index c8cf56f..ada6daa 100644 --- a/net/adc_netserver.h +++ b/net/adc_netserver.h @@ -9,7 +9,6 @@ ABSTRACT DEVICE COMPONENTS LIBRARY #include #include #include -#include #include #include diff --git a/net/asio/adc_netservice_asio.h b/net/asio/adc_netservice_asio.h index b908ac3..25bc0ea 100644 --- a/net/asio/adc_netservice_asio.h +++ b/net/asio/adc_netservice_asio.h @@ -134,6 +134,8 @@ public: using endpoint_t = typename TRANSPORT_PROTOT::endpoint; // typedefs for completion tokens (callbacks, required by 'adc_netservice_c' concept) + typedef std::error_code async_callback_err_t; + typedef std::function async_connect_callback_t; typedef std::function async_send_callback_t; typedef std::function async_receive_callback_t;