[#BIO_socket_wait]
= BIO&lowbar;socket&lowbar;wait
:mrdocs:

Wait on a socket until it is ready for I&sol;O or until `max&lowbar;time` elapses&period;

== Synopsis

Declared in `&lt;openssl&sol;bio&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
BIO&lowbar;socket&lowbar;wait(
    int fd,
    int for&lowbar;read,
    time&lowbar;t max&lowbar;time);
----

== Return Value

1 on success, 0 on timeout, or &hyphen;1 on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *fd*
| Socket file descriptor to poll&period;
| *for&lowbar;read*
| Non&hyphen;zero to wait for readability&semi; zero to wait for writability&period;
| *max&lowbar;time*
| Absolute deadline as a time&lowbar;t&semi; 0 means no timeout (succeed immediately)&period;
|===


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