CMakeLists.txt: requires C++23 standard

CMakeLists.txt: add compiler version checks
adc_netserver.h: add AdcTrivialLogger class (use of 'deduced this'
feature of C++23 standard); AdcGenericNetServer class now has basic
based on std::basic_ostream logging capability
This commit is contained in:
2024-11-11 18:36:54 +03:00
parent afa8d09ade
commit 6acc1f94ba
5 changed files with 143 additions and 20 deletions

View File

@@ -246,9 +246,11 @@ public:
_netService.asyncReceive(
[self, this](netservice_t::async_callback_err_t ec, message_t msg) {
if (ec) {
std::string str("asyncReceive operation completed with error: ");
netservice_t::formatError(ec, str);
_serverPtr->errorMessage(str);
// std::string str("asyncReceive operation completed with error: ");
// netservice_t::formatError(ec, str);
// _serverPtr->errorMessage(str);
_serverPtr->logError("asyncReceive operation completed with error: {}",
netservice_t::formattableError(ec));
stop();
} else {
auto msg_sptr = std::make_shared<message_t>(std::move(msg));
@@ -261,9 +263,11 @@ public:
*msg_sptr,
[self, msg_sptr, this](netservice_t::async_callback_err_t ec) {
if (ec) {
std::string str("asyncSend operation completed with error: ");
netservice_t::formatError(ec, str);
_serverPtr->errorMessage(str);
// std::string str("asyncSend operation completed with error: ");
// netservice_t::formatError(ec, str);
// _serverPtr->errorMessage(str);
_serverPtr->logError("asyncSend operation completed with error: {}",
netservice_t::formattableError(ec));
stop();
} else {
start();