[#BIO_accept_ex]
= BIO&lowbar;accept&lowbar;ex
:mrdocs:

Accept a connection on `accept&lowbar;sock,` optionally capturing the peer address&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
BIO&lowbar;accept&lowbar;ex(
    int accept&lowbar;sock,
    xref:BIO_ADDR.adoc[BIO&lowbar;ADDR]* addr,
    int options);
----

== Return Value

Accepted socket fd on success, or &hyphen;1 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *accept&lowbar;sock*
| Listening socket&period;
| *addr*
| Optional BIO&lowbar;ADDR filled with the peer address, or NULL&period;
| *options*
| BIO&lowbar;SOCK&lowbar;&ast; flags applied to the accepted socket (for example non&hyphen;blocking)&period;
|===


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