Sockets have some protocol-specific data that also needs moving.
diff --git a/asio/include/asio/detail/impl/reactive_socket_service_base.ipp b/asio/include/asio/detail/impl/reactive_socket_service_base.ipp index ad9d828..74b345c 100644 --- a/asio/include/asio/detail/impl/reactive_socket_service_base.ipp +++ b/asio/include/asio/detail/impl/reactive_socket_service_base.ipp
@@ -44,7 +44,7 @@ impl.state_ = 0; } -void reactive_socket_service_base::move_construct( +void reactive_socket_service_base::base_move_construct( reactive_socket_service_base::base_implementation_type& impl, reactive_socket_service_base::base_implementation_type& other_impl) { @@ -58,7 +58,7 @@ impl.reactor_data_, other_impl.reactor_data_); } -void reactive_socket_service_base::move_assign( +void reactive_socket_service_base::base_move_assign( reactive_socket_service_base::base_implementation_type& impl, reactive_socket_service_base& other_service, reactive_socket_service_base::base_implementation_type& other_impl)
diff --git a/asio/include/asio/detail/reactive_socket_service.hpp b/asio/include/asio/detail/reactive_socket_service.hpp index d7df7f1..72e5d03 100644 --- a/asio/include/asio/detail/reactive_socket_service.hpp +++ b/asio/include/asio/detail/reactive_socket_service.hpp
@@ -77,6 +77,27 @@ { } + // Move-construct a new socket implementation. + void move_construct(implementation_type& impl, + implementation_type& other_impl) + { + this->base_move_construct(impl, other_impl); + + impl.protocol_ = other_impl.protocol_; + other_impl.protocol_ = endpoint_type().protocol(); + } + + // Move-assign from another socket implementation. + void move_assign(implementation_type& impl, + reactive_socket_service_base& other_service, + implementation_type& other_impl) + { + this->base_move_assign(impl, other_service, other_impl); + + impl.protocol_ = other_impl.protocol_; + other_impl.protocol_ = endpoint_type().protocol(); + } + // Open a new socket implementation. asio::error_code open(implementation_type& impl, const protocol_type& protocol, asio::error_code& ec)
diff --git a/asio/include/asio/detail/reactive_socket_service_base.hpp b/asio/include/asio/detail/reactive_socket_service_base.hpp index af095b0..00e8652 100644 --- a/asio/include/asio/detail/reactive_socket_service_base.hpp +++ b/asio/include/asio/detail/reactive_socket_service_base.hpp
@@ -70,11 +70,11 @@ ASIO_DECL void construct(base_implementation_type& impl); // Move-construct a new socket implementation. - ASIO_DECL void move_construct(base_implementation_type& impl, + ASIO_DECL void base_move_construct(base_implementation_type& impl, base_implementation_type& other_impl); // Move-assign from another socket implementation. - ASIO_DECL void move_assign(base_implementation_type& impl, + ASIO_DECL void base_move_assign(base_implementation_type& impl, reactive_socket_service_base& other_service, base_implementation_type& other_impl);