85 bool connection_closed{
false};
93 if (ec.value() == boost::system::errc::success) {
95 std::uint32_t
const read_next_bytes = [&rx_buffer]() noexcept -> std::uint32_t {
96 return static_cast<std::uint32_t
>((
static_cast<std::uint32_t
>(rx_buffer[4u] << 24u) & 0xFF000000) |
97 (
static_cast<std::uint32_t
>(rx_buffer[5u] << 16u) & 0x00FF0000) |
98 (
static_cast<std::uint32_t
>(rx_buffer[6u] << 8u) & 0x0000FF00) |
99 (
static_cast<std::uint32_t
>(rx_buffer[7u] & 0x000000FF)));
106 Tcp::endpoint endpoint_{
tcp_socket_.remote_endpoint()};
108 std::make_unique<TcpMessage>(endpoint_.address().to_string(), endpoint_.port(), std::move(rx_buffer))};
110 __FILE__, __LINE__, __func__, [endpoint_](std::stringstream &msg) {
111 msg <<
"Tcp Message received from "
112 <<
"<" << endpoint_.address().to_string() <<
"," << endpoint_.port() <<
">";
116 }
else if (ec.value() == boost::asio::error::eof) {
118 __FILE__, __LINE__, __func__,
119 [ec](std::stringstream &msg) { msg <<
"Remote Disconnected with: " << ec.message(); });
120 connection_closed =
true;
123 __FILE__, __LINE__, __func__,
124 [ec](std::stringstream &msg) { msg <<
"Remote Disconnected with undefined error: " << ec.message(); });
125 connection_closed =
true;
127 return connection_closed;
static auto GetLibBoostLogger() noexcept -> LibBoostLogger &
std::vector< uint8_t > BufferType
Type alias for underlying buffer.
boost::system::error_code TcpErrorCodeType
constexpr std::uint8_t kDoipheadrSize
Doip HeaderSize.
std::unique_ptr< TcpMessage > TcpMessagePtr
The unique pointer to TcpMessage.