[#Sock-WaitMany]
= xref:Sock.adoc[Sock]::WaitMany
:relfileprefix: ../
:mrdocs:

Same as `Wait()`, but wait on many sockets within the same timeout&period;

== Synopsis

Declared in `&lt;util&sol;sock&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
virtual
bool
WaitMany(
    std::chrono::milliseconds timeout,
    xref:Sock/EventsPerSock.adoc[EventsPerSock]& events&lowbar;per&lowbar;sock) const;
----

== Return Value

true on success (or timeout, if all `what&lsqb;&rsqb;&period;occurred` are returned as 0), 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 long for at least one of the requested events to occur&period;
| *events&lowbar;per&lowbar;sock* [inout]
| Wait for the requested events on these sockets and set `occurred` for the events that actually occurred&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
