9 Error reporting [err.report]

9.2 Asynchronous operations [err.report.async]

Asynchronous network library functions in this document are identified by having the prefix async_ and take a completion handler ([async.reqmts.async.token]). These asynchronous operations report errors as follows:

  • If a call by the implementation to an operating system or other underlying API results in an error that prevents the asynchronous operation from meeting its specifications, the completion handler is invoked with an error_code value ec that is set as appropriate for the specific error. Otherwise, the error_code value ec is set such that !ec is true.

  • Asynchronous operations shall not fail with an error condition that indicates interruption of an operating system or underlying API by a signal. [ Note: Such as POSIX error number EINTR  — end note ] Asynchronous operations shall not fail with any error condition associated with non-blocking operations. [ Note: Such as POSIX error numbers EWOULDBLOCK, EAGAIN, or EINPROGRESS; Windows error numbers WSAEWOULDBLOCK or WSAEINPROGRESS  — end note ]

In this document, when a type requirement is specified as a call to a function or member function having the prefix async_, then the function shall satisfy the error reporting requirements described above.