This commit is contained in:
Zeiss-1000 observer
2026-10-17 20:19:23 +03:00
parent 443dfe1480
commit f3d7c4fed6

View File

@@ -71,14 +71,12 @@ public:
{ {
auto msg_bytes = msg.toBytes(); auto msg_bytes = msg.toBytes();
auto net_bytes = _reprProto.toNetwork(msg_bytes); auto net_bytes = _reprProto.toNetwork(msg_bytes);
if (net_bytes.flag != net_connection_t::net_repr_proto_t::result_flag_t::OK) {
}
switch (net_bytes.flag) { switch (net_bytes.flag) {
case net_connection_t::net_repr_proto_t::result_flag_t::NOT_ENOUGH_DATA: case net_connection_t::net_repr_proto_t::result_flag_t::NOT_ENOUGH_DATA:
co_return std::errc::message_size; co_return std::make_error_code(std::errc::message_size);
case net_connection_t::net_repr_proto_t::result_flag_t::INVALID_DATA: case net_connection_t::net_repr_proto_t::result_flag_t::INVALID_DATA:
co_return std::errc::invalid_argument; co_return std::make_error_code(std::errc::invalid_argument);
default: default:
break; break;
} }
@@ -137,7 +135,14 @@ public:
co_return ec; co_return ec;
} }
::asio::awaitable<net_connection_t::recv_result_t> recv() {} ::asio::awaitable<net_connection_t::recv_result_t> recv()
{
thread_local static ::asio::steady_timer timeout_timer(_socket.get_executor());
auto start_tp = std::chrono::steady_clock::now();
timeout_timer.expires_after(_recvTimeout);
}
::asio::awaitable<error_t> close() {} ::asio::awaitable<error_t> close() {}