Open travnick opened 1 year ago
Boost Asio sockets are moveable as documentation says
https://www.boost.org/doc/libs/1_81_0/doc/html/boost_asio/overview/cpp2011/move_objects.html
But there is no information how it behaves is original executor is wrapped with strand https://www.boost.org/doc/libs/1_81_0/doc/html/boost_asio/reference/basic_stream_socket/basic_stream_socket/overload9.html https://www.boost.org/doc/libs/1_81_0/doc/html/boost_asio/reference/strand/strand/overload5.html
So I did create a socket, with strand and then moved from it.
boost::asio::io_context context; boost::asio::ip::tcp::socket socket1{make_strand(context)}; boost::asio::ip::tcp::socket socket2{std::move(socket1)};
I assume that since move took place, then socket2 is simply a socket1 (before move).
socket2
socket1
The question is what is the executor of socket1?:
Is there any documentation of this case?
--edited at 14:41 on 2023-07-18 because of misspell the socket1/socket2
Boost Asio sockets are moveable as documentation says
https://www.boost.org/doc/libs/1_81_0/doc/html/boost_asio/overview/cpp2011/move_objects.html
But there is no information how it behaves is original executor is wrapped with strand https://www.boost.org/doc/libs/1_81_0/doc/html/boost_asio/reference/basic_stream_socket/basic_stream_socket/overload9.html https://www.boost.org/doc/libs/1_81_0/doc/html/boost_asio/reference/strand/strand/overload5.html
So I did create a socket, with strand and then moved from it.
I assume that since move took place, then
socket2
is simply asocket1
(before move).The question is what is the executor of
socket1
?:socket2
?Is there any documentation of this case?
--edited at 14:41 on 2023-07-18 because of misspell the socket1/socket2