Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

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.


s.non_blocking() == true,

— the synchronous socket operation is specified in terms of a POSIX function other than poll(),

— that POSIX function lists EWOULDBLOCK or EAGAIN in its failure conditions, and

— the effects of the operation cannot be established immediately

then the synchronous socket operation shall not block the calling thread. [Note: And the effects of the operation are not established. —end note]

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