summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/asio/src/doc/requirements/synchronous_socket_operations.qbk
blob: e6d52505c08c171a83ee1bc6e1a7d3d6b3781bd8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
[/
 / Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 /
 / Distributed under the Boost Software License, Version 1.0. (See accompanying
 / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 /]

[section:synchronous_socket_operations Requirements on synchronous socket operations]

In this section, ['synchronous socket operations] are those member functions
specified as two overloads, with and without an argument of type `error_code&`:

  ``[*['R f]]``(``['[*A1]]`` a1, ``['[*A2]]`` a2, ..., ``['[*AN]]`` aN);
  ``[*['R f]]``(``['[*A1]]`` a1, ``['[*A2]]`` a2, ..., ``['[*AN]]`` aN, error_code& ec);

For an object `s`, the conditions under which its synchronous socket operations
may block the calling thread (C++Std [defns.block]) are determined as follows.

If:

[mdash] `s.non_blocking() == true`,

[mdash] the synchronous socket operation is specified in terms of a __POSIX__
function other than `__poll__`,

[mdash] that __POSIX__ function lists `EWOULDBLOCK` or `EAGAIN`
in its failure conditions, and

[mdash] the effects of the operation cannot be established immediately

then the synchronous socket operation shall not block the calling thread.
[inline_note And the effects of the operation are not established.]

Otherwise, the synchronous socket operation shall block the calling thread
until the effects are established.

[endsect]