1[/ 2 / Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com) 3 / 4 / Distributed under the Boost Software License, Version 1.0. (See accompanying 5 / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 /] 7 8[section:read_write_operations Requirements on read and write operations] 9 10A ['read operation] is an operation that reads data into a mutable buffer 11sequence argument of a type meeting [link boost_asio.reference.MutableBufferSequence 12`MutableBufferSequence`] requirements. The mutable buffer sequence specifies 13memory where the data should be placed. A read operation shall always fill a 14buffer in the sequence completely before proceeding to the next. 15 16A ['write operation] is an operation that writes data from a constant buffer 17sequence argument of a type meeting [link boost_asio.reference.ConstBufferSequence 18`ConstBufferSequence`] requirements. The constant buffer sequence specifies 19memory where the data to be written is located. A write operation shall always 20write a buffer in the sequence completely before proceeding to the next. 21 22If a read or write operation is also an [link 23boost_asio.reference.asynchronous_operations asynchronous operation], the operation 24shall maintain one or more copies of the buffer sequence until such time as the 25operation no longer requires access to the memory specified by the buffers in 26the sequence. The program shall ensure the memory remains valid until: 27 28[mdash] the last copy of the buffer sequence is destroyed, or 29 30[mdash] the completion handler for the asynchronous operation is invoked, 31 32whichever comes first. 33 34[endsect] 35