[#BIO_new_socket]
= BIO&lowbar;new&lowbar;socket
:mrdocs:

Wrap an existing socket descriptor in a BIO&lowbar;s&lowbar;socket() BIO&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BIO.adoc[BIO]*
BIO&lowbar;new&lowbar;socket(
    int sock,
    int close&lowbar;flag);
----

== Return Value

New socket BIO, or NULL on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *sock*
| Socket file descriptor&period;
| *close&lowbar;flag*
| BIO&lowbar;CLOSE to close `sock` when the BIO is freed, or BIO&lowbar;NOCLOSE&period;
|===


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