From 438c238ab9be0532d82de8d5379c54e562a38247 Mon Sep 17 00:00:00 2001 From: Richard Hodges Date: Fri, 1 May 2020 17:42:28 +0200 Subject: [PATCH] Comment move behaviour of basic_stream resolves #1917 --- include/boost/beast/core/impl/basic_stream.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/boost/beast/core/impl/basic_stream.hpp b/include/boost/beast/core/impl/basic_stream.hpp index 36bd6b84..2fc9f793 100644 --- a/include/boost/beast/core/impl/basic_stream.hpp +++ b/include/boost/beast/core/impl/basic_stream.hpp @@ -681,7 +681,12 @@ basic_stream(basic_stream&& other) : impl_(boost::make_shared( std::move(*other.impl_))) { - // VFALCO I'm not sure this implementation is correct... + // Explainer: Asio's sockets provide the guarantee that a moved-from socket + // will be in a state as-if newly created. i.e.: + // * having the same (valid) executor + // * the socket shall not be open + // We provide the same guarantee by moving the impl rather than the pointer + // controlling its lifetime. } //------------------------------------------------------------------------------