Wait for readiness for input (recv) or output (send).

Synopsis

Declared in <util/sock.h>

[[nodiscard]]
virtual
bool
Wait(
    std::chrono::milliseconds timeout,
    Event requested,
    Event* occurred = nullptr) const;

Return Value

true on success (or timeout, if occurred of 0 is returned), false otherwise

Note

The return value should not be discarded.

Parameters

Name

Description

timeout [in]

Wait this much for at least one of the requested events to occur.

requested [in]

Wait for those events, bitwise‐or of RecvEvent and SendEvent.

occurred [out]

If not nullptr and the function returns true, then this indicates which of the requested events occurred (ErrorEvent will be added, even if not requested, if an exceptional event occurs on the socket). A timeout is indicated by return value of true and occurred being set to 0.

Created with MrDocs