[#Sock-Wait] = xref:Sock.adoc[Sock]::Wait :relfileprefix: ../ :mrdocs: Wait for readiness for input (recv) or output (send). == Synopsis Declared in `<util/sock.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] virtual bool Wait( std::chrono::milliseconds timeout, xref:Sock/Event.adoc[Event] requested, xref:Sock/Event.adoc[Event]* occurred = nullptr) const; ---- == Return Value true on success (or timeout, if `occurred` of 0 is returned), false otherwise [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Parameters [cols="1,4"] |=== | 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. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#