This commit is contained in:
Timur A. Fatkhullin
2024-11-09 23:51:40 +03:00
parent afd1a917b4
commit afa8d09ade
5 changed files with 22 additions and 14 deletions

View File

@@ -246,8 +246,9 @@ public:
_netService.asyncReceive(
[self, this](netservice_t::async_callback_err_t ec, message_t msg) {
if (ec) {
_serverPtr->errorMessage(std::string("asyncReceive operation completed with") +
netservice_t::formatError(ec));
std::string str("asyncReceive operation completed with error: ");
netservice_t::formatError(ec, str);
_serverPtr->errorMessage(str);
stop();
} else {
auto msg_sptr = std::make_shared<message_t>(std::move(msg));
@@ -260,8 +261,9 @@ public:
*msg_sptr,
[self, msg_sptr, this](netservice_t::async_callback_err_t ec) {
if (ec) {
_serverPtr->errorMessage(std::string("asyncSend operation completed with") +
netservice_t::formatError(ec));
std::string str("asyncSend operation completed with error: ");
netservice_t::formatError(ec, str);
_serverPtr->errorMessage(str);
stop();
} else {
start();
@@ -391,9 +393,6 @@ public:
auto id = std::forward<IdSerialT>(id_ser_func)(dev_ptr->ident());
_devices.try_emplace(dev_ptr, dev_ptr, id, std::forward<AttrIdDeserialT>(attr_id_deser_func),
std::forward<CmdIdDeserialT>(cmd_id_deser_func));
// _devices.try_emplace(dev_ptr, dev_ptr, std::forward<IdSerialT>(id_ser_func),
// std::forward<AttrIdDeserialT>(attr_id_deser_func),
// std::forward<CmdIdDeserialT>(cmd_id_deser_func));
return *this;
}