[#Sock-2constructor-07]
= xref:Sock.adoc[Sock]::Sock
:relfileprefix: ../
:mrdocs:

Constructors

== Synopses

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

Default construction is disabled&colon; a `Sock` always wraps an existing socket&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:Sock/2constructor-03.adoc[Sock]() = delete;
----

[.small]#xref:Sock/2constructor-03.adoc[_» more&period;&period;&period;_]#

Copy constructor, disabled because closing the same socket twice is undesirable&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:Sock/2constructor-08.adoc[Sock](xref:Sock.adoc[Sock] const& other) = delete;
----

[.small]#xref:Sock/2constructor-08.adoc[_» more&period;&period;&period;_]#

Move constructor, grab the socket from another object and close ours (if set)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:Sock/2constructor-02b.adoc[Sock](xref:Sock.adoc[Sock]&& other);
----

[.small]#xref:Sock/2constructor-02b.adoc[_» more&period;&period;&period;_]#

Take ownership of an existent socket&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:Sock/2constructor-029.adoc[Sock](xref:SOCKET.adoc[SOCKET] s);
----

[.small]#xref:Sock/2constructor-029.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *other*
| The socket wrapper that would be copied&period;
| *s*
| The socket descriptor to take ownership of&period;
|===


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