6 Mar
2024
6 Mar
'24
2:36 p.m.
Hi, The most obvious error that I see is that you use `std::vector<char> buffer_data(1024);`as local variables and then they are destroyed but you continue to keep references to them via the boost::asio::buffer. The latter will not keep the `std::vector`s alive. You need to keep the std::vector as a member variable and only when you call the asio functions use the `boost::asio::buffer` function. Like m_socketHandler->socket.async_read_some(boost::asio::buffer(m_buffer_data), ... Where the m_buffer_data is a member variable of type `std::vector<char>`. HTH, Pavel.
265
Age (days ago)
265
Last active (days ago)
0 comments
1 participants
participants (1)
-
Pavel Vazharov