2 / Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
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)
8 [section:SyncWriteStream Buffer-oriented synchronous write stream requirements]
10 In the table below, `a` denotes a synchronous write stream object, `cb` denotes
11 an object satisfying [link boost_asio.reference.ConstBufferSequence constant
12 buffer sequence] requirements, and `ec` denotes an object of type `error_code`.
14 [table Buffer-oriented synchronous write stream requirements
15 [[operation] [type] [semantics, pre/post-conditions]]
22 size_t s = a.write_some(cb, ec);
23 if (ec) throw system_error(ec);
28 [`a.write_some(cb, ec);`]
31 Writes one or more bytes of data to the stream `a`.\n
33 The constant buffer sequence `cb` specifies memory where the data to be
34 written is located. The `write_some` operation shall always write a
35 buffer in the sequence completely before proceeding to the next.\n
37 If successful, returns the number of bytes written and sets `ec` such
38 that `!ec` is true. If an error occurred, returns `0` and sets `ec` such
39 that `!!ec` is true.\n
41 If the total size of all buffers in the sequence `cb` is `0`, the
42 function shall return `0` immediately.