\section{socket\+: General socket manipulations}
\label{group__socket}\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsection*{IP socket functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{group__socket_gac3ff4662c65f65784534be54ef73a5c1}{socket\+\_\+tcp4} (void)
\item 
int \hyperlink{group__socket_gaa40101a7969252728f0f29a7b40afbb0}{socket\+\_\+tcp6} (void)
\item 
int \hyperlink{group__socket_ga88d576380c2025501e9a8266bcddc759}{socket\+\_\+tcp} (void)
\item 
int \hyperlink{group__socket_ga6f5bd2aa2b03be301bdd402a96d8c1cc}{socket\+\_\+udp4} (void)
\item 
int \hyperlink{group__socket_ga97257e7446c72c21b3b80b56efae5114}{socket\+\_\+udp6} (void)
\item 
int \hyperlink{group__socket_gaaa146f612229109460767f7b33264436}{socket\+\_\+udp} (void)
\item 
int \hyperlink{group__socket_gad2216a950b5878a7480f2cbba5bb923a}{socket\+\_\+connect4} (int sock, const \hyperlink{structipv4addr}{ipv4addr} $\ast$ip, \hyperlink{group__ipv4_ga113bbf93f3b0011263ce519bb1ca7481}{ipv4port} port)
\item 
int \hyperlink{group__socket_ga758f2bc0d9366148f783e391b918c6e7}{socket\+\_\+connect4\+\_\+timeout} (int sock, const \hyperlink{structipv4addr}{ipv4addr} $\ast$ip, \hyperlink{group__ipv4_ga113bbf93f3b0011263ce519bb1ca7481}{ipv4port} port, int timeout)
\item 
int \hyperlink{group__socket_ga748c5c143180e767205d07f047ca679d}{socket\+\_\+connect6} (int sock, const \hyperlink{structipv6addr}{ipv6addr} $\ast$ip, \hyperlink{group__ipv6_gaa71ffb8f46cd4fa830090d23eb752847}{ipv6port} port)
\item 
int \hyperlink{group__socket_gad0524d7851f2c470f69560eb84730c5b}{socket\+\_\+connect6\+\_\+timeout} (int sock, const \hyperlink{structipv6addr}{ipv6addr} $\ast$ip, \hyperlink{group__ipv6_gaa71ffb8f46cd4fa830090d23eb752847}{ipv6port} port, int timeout)
\item 
int \hyperlink{group__socket_ga456030863437a411c047f2cd2580bdc0}{socket\+\_\+bind4} (int sock, const \hyperlink{structipv4addr}{ipv4addr} $\ast$ip, \hyperlink{group__ipv4_ga113bbf93f3b0011263ce519bb1ca7481}{ipv4port} port)
\item 
int \hyperlink{group__socket_ga7a5368c8328a7dece54a854fb973f643}{socket\+\_\+bind6} (int sock, const \hyperlink{structipv6addr}{ipv6addr} $\ast$ip, \hyperlink{group__ipv6_gaa71ffb8f46cd4fa830090d23eb752847}{ipv6port} port)
\item 
int \hyperlink{group__socket_gac7bc14346128667097799f4754d37929}{socket\+\_\+accept4} (int sock, \hyperlink{structipv4addr}{ipv4addr} $\ast$ip, \hyperlink{group__ipv4_ga113bbf93f3b0011263ce519bb1ca7481}{ipv4port} $\ast$port)
\item 
int \hyperlink{group__socket_ga196889012f2f3d11f509233255e2ac99}{socket\+\_\+accept6} (int sock, \hyperlink{structipv6addr}{ipv6addr} $\ast$ip, \hyperlink{group__ipv6_gaa71ffb8f46cd4fa830090d23eb752847}{ipv6port} $\ast$port)
\item 
int \hyperlink{group__socket_ga1a5ee61f2d55733cb8fd5b359d10a7a1}{socket\+\_\+recv4} (int sock, char $\ast$buffer, unsigned buflen, \hyperlink{structipv4addr}{ipv4addr} $\ast$ip, \hyperlink{group__ipv4_ga113bbf93f3b0011263ce519bb1ca7481}{ipv4port} $\ast$port)
\item 
int \hyperlink{group__socket_gabd201f10a5f8a183a47f4c04094611f2}{socket\+\_\+recv6} (int sock, char $\ast$buffer, unsigned buflen, \hyperlink{structipv6addr}{ipv6addr} $\ast$ip, \hyperlink{group__ipv6_gaa71ffb8f46cd4fa830090d23eb752847}{ipv6port} $\ast$port)
\item 
int \hyperlink{group__socket_ga6c2d6ff938d1d397727eed25c7eec506}{socket\+\_\+send4} (int sock, const char $\ast$buffer, unsigned buflen, const \hyperlink{structipv4addr}{ipv4addr} $\ast$ip, \hyperlink{group__ipv4_ga113bbf93f3b0011263ce519bb1ca7481}{ipv4port} port)
\item 
int \hyperlink{group__socket_ga59f8b78cd870be6e55b0205ce69780b1}{socket\+\_\+send6} (int sock, const char $\ast$buffer, unsigned buflen, const \hyperlink{structipv6addr}{ipv6addr} $\ast$ip, \hyperlink{group__ipv6_gaa71ffb8f46cd4fa830090d23eb752847}{ipv6port} port)
\item 
int \hyperlink{group__socket_ga0af45ad3d942c5e666c6c849612b31b9}{socket\+\_\+getaddr4} (int sock, \hyperlink{structipv4addr}{ipv4addr} $\ast$ip, \hyperlink{group__ipv4_ga113bbf93f3b0011263ce519bb1ca7481}{ipv4port} $\ast$port)
\item 
int \hyperlink{group__socket_ga369bac4cc0a9f7b0102619c3c51c7b9b}{socket\+\_\+getaddr6} (int sock, \hyperlink{structipv6addr}{ipv6addr} $\ast$ip, \hyperlink{group__ipv6_gaa71ffb8f46cd4fa830090d23eb752847}{ipv6port} $\ast$port)
\item 
int \hyperlink{group__socket_ga9b04337ecf3bf5baa28b40452cd21222}{socket\+\_\+cork} (int sock)
\item 
int \hyperlink{group__socket_gae754518918db3d63dda03d9fd7497f24}{socket\+\_\+uncork} (int sock)
\item 
int \hyperlink{group__socket_ga3e40999be94c2b893b7b143b6b15e85e}{socket\+\_\+notcpdelay} (int sock, int enable)
\end{DoxyCompactItemize}
\subsection*{U\+N\+IX local-\/domain socket functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{group__socket_ga3c74e521debc5d71da6cb975c24f5a6f}{socket\+\_\+unixdgm} (void)
\item 
int \hyperlink{group__socket_ga8d8f154af4bc27c718676848aeca4517}{socket\+\_\+unixstr} (void)
\item 
int \hyperlink{group__socket_gaba7a8b6004c3a3b4ec2760654b932d34}{socket\+\_\+connectu} (int sock, const char $\ast$path)
\item 
int \hyperlink{group__socket_ga60efe220e9b4f32c40f1f23ee856f9f2}{socket\+\_\+connectu\+\_\+timeout} (int sock, const char $\ast$path, int timeout)
\item 
int \hyperlink{group__socket_gab8bb1362103f0b7d0b92a26740a25202}{socket\+\_\+bindu} (int sock, const char $\ast$path)
\item 
int \hyperlink{group__socket_ga47526944d4d396e915254ad74b1718cd}{socket\+\_\+acceptu} (int sock)
\item 
int \hyperlink{group__socket_ga4a076351ffd2c95067db1d480aad0d74}{socket\+\_\+recvu} (int sock, char $\ast$buffer, unsigned buflen)
\item 
int \hyperlink{group__socket_ga2e1e867a59f55178bd91943937be27e8}{socket\+\_\+sendu} (int sock, const char $\ast$buffer, unsigned buflen)
\item 
int \hyperlink{group__socket_ga2ee545eb11adc079c12653558ce1d43a}{socket\+\_\+pairstr} (int fd\mbox{[}2\mbox{]})
\item 
int \hyperlink{group__socket_ga3518be90b2771241b0dd8330763f524a}{socket\+\_\+pairdgm} (int fd\mbox{[}2\mbox{]})
\end{DoxyCompactItemize}
\subsection*{Functions for any type of socket}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{group__socket_ga1cd775b2c588a9c1c9f993d760088e4c}{socket\+\_\+broadcast} (int sock)
\item 
int \hyperlink{group__socket_gabfc66cb9c05f20a016cec536293d391e}{socket\+\_\+connected} (int sock)
\item 
int \hyperlink{group__socket_ga30b66242db4c2ac40b93f73bbe6d4add}{socket\+\_\+linger} (int fd, int onoff, int seconds)
\item 
int \hyperlink{group__socket_gadc9f509d40c47189452bbde14b5d4fee}{socket\+\_\+listen} (int sock, int backlog)
\item 
int \hyperlink{group__socket_ga3836ac2b7108e2f6e203278c846ef56e}{socket\+\_\+reuse} (int sock)
\item 
int \hyperlink{group__socket_gac91dfda7ec1b043b277fdcd205eb79e8}{socket\+\_\+shutdown} (int sock, int shut\+\_\+rd, int shut\+\_\+wr)
\item 
int \hyperlink{group__socket_ga0b2ab1619356b51c379c3b3cfd047bf9}{socket\+\_\+sendfd} (int sock, int fd)
\item 
int \hyperlink{group__socket_ga45a3df16f6b78995662a5a3f485f5edb}{socket\+\_\+recvfd} (int sock)
\end{DoxyCompactItemize}


\subsection{Detailed Description}
\begin{DoxyParagraph}{Calling Convention}

\end{DoxyParagraph}
When calling a socket function, the socket file descriptor (where required) will always be the first parameter. Functions that return a file descriptor (either creating a new socket or accepting a connection on a socket return that file descriptor on success or {\ttfamily -\/1} on error. All other functions return non-\/zero (true) on success or {\ttfamily 0} (false) on error. All functions set errno on error. 

\subsection{Function Documentation}
\mbox{\label{group__socket_gac7bc14346128667097799f4754d37929}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+accept4@{socket\+\_\+accept4}}
\index{socket\+\_\+accept4@{socket\+\_\+accept4}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+accept4()}{socket\_accept4()}}
{\footnotesize\ttfamily int socket\+\_\+accept4 (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{\hyperlink{structipv4addr}{ipv4addr} $\ast$}]{ip,  }\item[{\hyperlink{group__ipv4_ga113bbf93f3b0011263ce519bb1ca7481}{ipv4port} $\ast$}]{port }\end{DoxyParamCaption})}

Accept a connection on a socket from an I\+Pv4 address. 

References ipv4addr\+::addr.

\mbox{\label{group__socket_ga196889012f2f3d11f509233255e2ac99}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+accept6@{socket\+\_\+accept6}}
\index{socket\+\_\+accept6@{socket\+\_\+accept6}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+accept6()}{socket\_accept6()}}
{\footnotesize\ttfamily int socket\+\_\+accept6 (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{\hyperlink{structipv6addr}{ipv6addr} $\ast$}]{ip,  }\item[{\hyperlink{group__ipv6_gaa71ffb8f46cd4fa830090d23eb752847}{ipv6port} $\ast$}]{port }\end{DoxyParamCaption})}

Accept a connection on a socket from an I\+Pv6 address. 

References ipv6addr\+::addr.

\mbox{\label{group__socket_ga47526944d4d396e915254ad74b1718cd}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+acceptu@{socket\+\_\+acceptu}}
\index{socket\+\_\+acceptu@{socket\+\_\+acceptu}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+acceptu()}{socket\_acceptu()}}
{\footnotesize\ttfamily int socket\+\_\+acceptu (\begin{DoxyParamCaption}\item[{int}]{sock }\end{DoxyParamCaption})}

Accept a U\+N\+IX domain connection. \mbox{\label{group__socket_ga456030863437a411c047f2cd2580bdc0}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+bind4@{socket\+\_\+bind4}}
\index{socket\+\_\+bind4@{socket\+\_\+bind4}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+bind4()}{socket\_bind4()}}
{\footnotesize\ttfamily int socket\+\_\+bind4 (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{const \hyperlink{structipv4addr}{ipv4addr} $\ast$}]{ip,  }\item[{\hyperlink{group__ipv4_ga113bbf93f3b0011263ce519bb1ca7481}{ipv4port}}]{port }\end{DoxyParamCaption})}

Bind a socket to an I\+Pv4 address. 

References ipv4addr\+::addr.



Referenced by dns\+\_\+transmit\+\_\+free(), and socket\+\_\+connect4().

\mbox{\label{group__socket_ga7a5368c8328a7dece54a854fb973f643}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+bind6@{socket\+\_\+bind6}}
\index{socket\+\_\+bind6@{socket\+\_\+bind6}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+bind6()}{socket\_bind6()}}
{\footnotesize\ttfamily int socket\+\_\+bind6 (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{const \hyperlink{structipv6addr}{ipv6addr} $\ast$}]{ip,  }\item[{\hyperlink{group__ipv6_gaa71ffb8f46cd4fa830090d23eb752847}{ipv6port}}]{port }\end{DoxyParamCaption})}

Bind a socket to an I\+Pv6 address. 

References ipv6addr\+::addr.

\mbox{\label{group__socket_gab8bb1362103f0b7d0b92a26740a25202}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+bindu@{socket\+\_\+bindu}}
\index{socket\+\_\+bindu@{socket\+\_\+bindu}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+bindu()}{socket\_bindu()}}
{\footnotesize\ttfamily int socket\+\_\+bindu (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{const char $\ast$}]{path }\end{DoxyParamCaption})}

Bind a U\+N\+IX domain address (path) to a socket. \mbox{\label{group__socket_ga1cd775b2c588a9c1c9f993d760088e4c}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+broadcast@{socket\+\_\+broadcast}}
\index{socket\+\_\+broadcast@{socket\+\_\+broadcast}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+broadcast()}{socket\_broadcast()}}
{\footnotesize\ttfamily int socket\+\_\+broadcast (\begin{DoxyParamCaption}\item[{int}]{fd }\end{DoxyParamCaption})}

Mark a socket for broadcast transmission. \mbox{\label{group__socket_gad2216a950b5878a7480f2cbba5bb923a}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+connect4@{socket\+\_\+connect4}}
\index{socket\+\_\+connect4@{socket\+\_\+connect4}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+connect4()}{socket\_connect4()}}
{\footnotesize\ttfamily int socket\+\_\+connect4 (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{const \hyperlink{structipv4addr}{ipv4addr} $\ast$}]{ip,  }\item[{\hyperlink{group__ipv4_ga113bbf93f3b0011263ce519bb1ca7481}{ipv4port}}]{port }\end{DoxyParamCaption})}

Connect a socket to an I\+Pv4 address. 

References ipv4addr\+::addr, I\+P\+V4\+A\+D\+D\+R\+\_\+\+A\+NY, I\+P\+V4\+A\+D\+D\+R\+\_\+\+L\+O\+O\+P\+B\+A\+CK, socket\+\_\+bind4(), socket\+\_\+listen(), socket\+\_\+reuse(), and socket\+\_\+tcp4().



Referenced by dns\+\_\+transmit\+\_\+free(), and socket\+\_\+connect4\+\_\+timeout().

\mbox{\label{group__socket_ga758f2bc0d9366148f783e391b918c6e7}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+connect4\+\_\+timeout@{socket\+\_\+connect4\+\_\+timeout}}
\index{socket\+\_\+connect4\+\_\+timeout@{socket\+\_\+connect4\+\_\+timeout}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+connect4\+\_\+timeout()}{socket\_connect4\_timeout()}}
{\footnotesize\ttfamily int socket\+\_\+connect4\+\_\+timeout (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{const \hyperlink{structipv4addr}{ipv4addr} $\ast$}]{ip,  }\item[{\hyperlink{group__ipv4_ga113bbf93f3b0011263ce519bb1ca7481}{ipv4port}}]{port,  }\item[{int}]{timeout }\end{DoxyParamCaption})}

Connect a socket to an I\+Pv4 address, honouring a timeout.

\begin{DoxyNote}{Note}
The socket will have nonblocking mode turned on on return from this function. 
\end{DoxyNote}


References socket\+\_\+connect4(), and socket\+\_\+connected().

\mbox{\label{group__socket_ga748c5c143180e767205d07f047ca679d}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+connect6@{socket\+\_\+connect6}}
\index{socket\+\_\+connect6@{socket\+\_\+connect6}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+connect6()}{socket\_connect6()}}
{\footnotesize\ttfamily int socket\+\_\+connect6 (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{const \hyperlink{structipv6addr}{ipv6addr} $\ast$}]{ip,  }\item[{\hyperlink{group__ipv6_gaa71ffb8f46cd4fa830090d23eb752847}{ipv6port}}]{port }\end{DoxyParamCaption})}

Connect a socket to an I\+Pv6 address. 

References ipv6addr\+::addr.



Referenced by socket\+\_\+connect6\+\_\+timeout().

\mbox{\label{group__socket_gad0524d7851f2c470f69560eb84730c5b}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+connect6\+\_\+timeout@{socket\+\_\+connect6\+\_\+timeout}}
\index{socket\+\_\+connect6\+\_\+timeout@{socket\+\_\+connect6\+\_\+timeout}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+connect6\+\_\+timeout()}{socket\_connect6\_timeout()}}
{\footnotesize\ttfamily int socket\+\_\+connect6\+\_\+timeout (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{const \hyperlink{structipv6addr}{ipv6addr} $\ast$}]{ip,  }\item[{\hyperlink{group__ipv6_gaa71ffb8f46cd4fa830090d23eb752847}{ipv6port}}]{port,  }\item[{int}]{timeout }\end{DoxyParamCaption})}

Connect a socket to an I\+Pv6 address, honouring a timeout.

\begin{DoxyNote}{Note}
The socket will have nonblocking mode turned on on return from this function. 
\end{DoxyNote}


References socket\+\_\+connect6(), and socket\+\_\+connected().

\mbox{\label{group__socket_gabfc66cb9c05f20a016cec536293d391e}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+connected@{socket\+\_\+connected}}
\index{socket\+\_\+connected@{socket\+\_\+connected}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+connected()}{socket\_connected()}}
{\footnotesize\ttfamily int socket\+\_\+connected (\begin{DoxyParamCaption}\item[{int}]{sock }\end{DoxyParamCaption})}

Test if a socket is connected. 

Referenced by dns\+\_\+transmit\+\_\+get(), socket\+\_\+connect4\+\_\+timeout(), socket\+\_\+connect6\+\_\+timeout(), and socket\+\_\+connectu\+\_\+timeout().

\mbox{\label{group__socket_gaba7a8b6004c3a3b4ec2760654b932d34}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+connectu@{socket\+\_\+connectu}}
\index{socket\+\_\+connectu@{socket\+\_\+connectu}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+connectu()}{socket\_connectu()}}
{\footnotesize\ttfamily int socket\+\_\+connectu (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{const char $\ast$}]{path }\end{DoxyParamCaption})}

Make an U\+N\+IX domain connection. 

Referenced by socket\+\_\+connectu\+\_\+timeout().

\mbox{\label{group__socket_ga60efe220e9b4f32c40f1f23ee856f9f2}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+connectu\+\_\+timeout@{socket\+\_\+connectu\+\_\+timeout}}
\index{socket\+\_\+connectu\+\_\+timeout@{socket\+\_\+connectu\+\_\+timeout}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+connectu\+\_\+timeout()}{socket\_connectu\_timeout()}}
{\footnotesize\ttfamily int socket\+\_\+connectu\+\_\+timeout (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{const char $\ast$}]{path,  }\item[{int}]{timeout }\end{DoxyParamCaption})}

Connect a socket to an U\+N\+IX domain address, honouring a timeout.

\begin{DoxyNote}{Note}
The socket will have nonblocking mode turned on on return from this function. 
\end{DoxyNote}


References socket\+\_\+connected(), and socket\+\_\+connectu().

\mbox{\label{group__socket_ga9b04337ecf3bf5baa28b40452cd21222}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+cork@{socket\+\_\+cork}}
\index{socket\+\_\+cork@{socket\+\_\+cork}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+cork()}{socket\_cork()}}
{\footnotesize\ttfamily int socket\+\_\+cork (\begin{DoxyParamCaption}\item[{int}]{sock }\end{DoxyParamCaption})}

Stop a T\+CP socket from sending short writes.

Several U\+N\+IX OS\textquotesingle{}s have a facility which can prevent packets from being sent across the wire until they are completely full, even if short writes are sent to the socket that would normally result in output packets. This routine attempts to enable that facility to optimize throughput for bulk data transfers. It is known to work on Linux (with the {\ttfamily T\+C\+P\+\_\+\+C\+O\+RK} option) and to at least compile on B\+SD (with the {\ttfamily T\+C\+P\+\_\+\+N\+O\+P\+U\+SH} option). On OS\textquotesingle{}s which lack either of these two options, this function is essentially a no-\/op. \mbox{\label{group__socket_ga0af45ad3d942c5e666c6c849612b31b9}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+getaddr4@{socket\+\_\+getaddr4}}
\index{socket\+\_\+getaddr4@{socket\+\_\+getaddr4}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+getaddr4()}{socket\_getaddr4()}}
{\footnotesize\ttfamily int socket\+\_\+getaddr4 (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{\hyperlink{structipv4addr}{ipv4addr} $\ast$}]{addr,  }\item[{\hyperlink{group__ipv4_ga113bbf93f3b0011263ce519bb1ca7481}{ipv4port} $\ast$}]{port }\end{DoxyParamCaption})}

Determine the I\+Pv4 address of a socket. 

References ipv4addr\+::addr.

\mbox{\label{group__socket_ga369bac4cc0a9f7b0102619c3c51c7b9b}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+getaddr6@{socket\+\_\+getaddr6}}
\index{socket\+\_\+getaddr6@{socket\+\_\+getaddr6}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+getaddr6()}{socket\_getaddr6()}}
{\footnotesize\ttfamily int socket\+\_\+getaddr6 (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{\hyperlink{structipv6addr}{ipv6addr} $\ast$}]{addr,  }\item[{\hyperlink{group__ipv6_gaa71ffb8f46cd4fa830090d23eb752847}{ipv6port} $\ast$}]{port }\end{DoxyParamCaption})}

Determine the I\+Pv6 address of a socket. 

References ipv6addr\+::addr.

\mbox{\label{group__socket_ga30b66242db4c2ac40b93f73bbe6d4add}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+linger@{socket\+\_\+linger}}
\index{socket\+\_\+linger@{socket\+\_\+linger}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+linger()}{socket\_linger()}}
{\footnotesize\ttfamily int socket\+\_\+linger (\begin{DoxyParamCaption}\item[{int}]{fd,  }\item[{int}]{onoff,  }\item[{int}]{seconds }\end{DoxyParamCaption})}

Set the socket \char`\"{}linger\char`\"{} option. \mbox{\label{group__socket_gadc9f509d40c47189452bbde14b5d4fee}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+listen@{socket\+\_\+listen}}
\index{socket\+\_\+listen@{socket\+\_\+listen}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+listen()}{socket\_listen()}}
{\footnotesize\ttfamily int socket\+\_\+listen (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{int}]{backlog }\end{DoxyParamCaption})}

Listen to a socket. 

Referenced by socket\+\_\+connect4().

\mbox{\label{group__socket_ga3e40999be94c2b893b7b143b6b15e85e}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+notcpdelay@{socket\+\_\+notcpdelay}}
\index{socket\+\_\+notcpdelay@{socket\+\_\+notcpdelay}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+notcpdelay()}{socket\_notcpdelay()}}
{\footnotesize\ttfamily int socket\+\_\+notcpdelay (\begin{DoxyParamCaption}\item[{int}]{fd,  }\item[{int}]{on }\end{DoxyParamCaption})}

Turn on or off T\+CP N\+O\+D\+E\+L\+AY flag.

Enabling N\+O\+D\+E\+L\+AY disables the standard Nagle algorithm, which tries to coalesce multiple short writes into one larger packet for better network efficiency. With N\+O\+D\+E\+L\+AY enabled, each write will immediately be sent out onto the network as a seperate packet. \mbox{\label{group__socket_ga3518be90b2771241b0dd8330763f524a}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+pairdgm@{socket\+\_\+pairdgm}}
\index{socket\+\_\+pairdgm@{socket\+\_\+pairdgm}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+pairdgm()}{socket\_pairdgm()}}
{\footnotesize\ttfamily int socket\+\_\+pairdgm (\begin{DoxyParamCaption}\item[{int}]{fd\mbox{[}2\mbox{]} }\end{DoxyParamCaption})}

Create a pair of datagram sockets. \mbox{\label{group__socket_ga2ee545eb11adc079c12653558ce1d43a}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+pairstr@{socket\+\_\+pairstr}}
\index{socket\+\_\+pairstr@{socket\+\_\+pairstr}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+pairstr()}{socket\_pairstr()}}
{\footnotesize\ttfamily int socket\+\_\+pairstr (\begin{DoxyParamCaption}\item[{int}]{fd\mbox{[}2\mbox{]} }\end{DoxyParamCaption})}

Create a pair of stream sockets. \mbox{\label{group__socket_ga1a5ee61f2d55733cb8fd5b359d10a7a1}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+recv4@{socket\+\_\+recv4}}
\index{socket\+\_\+recv4@{socket\+\_\+recv4}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+recv4()}{socket\_recv4()}}
{\footnotesize\ttfamily int socket\+\_\+recv4 (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{char $\ast$}]{buffer,  }\item[{unsigned}]{buflen,  }\item[{\hyperlink{structipv4addr}{ipv4addr} $\ast$}]{ip,  }\item[{\hyperlink{group__ipv4_ga113bbf93f3b0011263ce519bb1ca7481}{ipv4port} $\ast$}]{port }\end{DoxyParamCaption})}

Receive a datagram from a U\+DP socket. 

References ipv4addr\+::addr.

\mbox{\label{group__socket_gabd201f10a5f8a183a47f4c04094611f2}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+recv6@{socket\+\_\+recv6}}
\index{socket\+\_\+recv6@{socket\+\_\+recv6}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+recv6()}{socket\_recv6()}}
{\footnotesize\ttfamily int socket\+\_\+recv6 (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{char $\ast$}]{buffer,  }\item[{unsigned}]{buflen,  }\item[{\hyperlink{structipv6addr}{ipv6addr} $\ast$}]{ip,  }\item[{\hyperlink{group__ipv6_gaa71ffb8f46cd4fa830090d23eb752847}{ipv6port} $\ast$}]{port }\end{DoxyParamCaption})}

Receive a datagram from an I\+Pv6 U\+DP socket. 

References ipv6addr\+::addr.

\mbox{\label{group__socket_ga45a3df16f6b78995662a5a3f485f5edb}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+recvfd@{socket\+\_\+recvfd}}
\index{socket\+\_\+recvfd@{socket\+\_\+recvfd}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+recvfd()}{socket\_recvfd()}}
{\footnotesize\ttfamily int socket\+\_\+recvfd (\begin{DoxyParamCaption}\item[{int}]{sock }\end{DoxyParamCaption})}

Receive a file descriptor over a socket. \mbox{\label{group__socket_ga4a076351ffd2c95067db1d480aad0d74}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+recvu@{socket\+\_\+recvu}}
\index{socket\+\_\+recvu@{socket\+\_\+recvu}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+recvu()}{socket\_recvu()}}
{\footnotesize\ttfamily int socket\+\_\+recvu (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{char $\ast$}]{buffer,  }\item[{unsigned}]{buflen }\end{DoxyParamCaption})}

Receive a datagram from a U\+N\+IX domain socket. \mbox{\label{group__socket_ga3836ac2b7108e2f6e203278c846ef56e}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+reuse@{socket\+\_\+reuse}}
\index{socket\+\_\+reuse@{socket\+\_\+reuse}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+reuse()}{socket\_reuse()}}
{\footnotesize\ttfamily int socket\+\_\+reuse (\begin{DoxyParamCaption}\item[{int}]{fd }\end{DoxyParamCaption})}

Mark a socket for address reuse. 

Referenced by socket\+\_\+connect4().

\mbox{\label{group__socket_ga6c2d6ff938d1d397727eed25c7eec506}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+send4@{socket\+\_\+send4}}
\index{socket\+\_\+send4@{socket\+\_\+send4}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+send4()}{socket\_send4()}}
{\footnotesize\ttfamily int socket\+\_\+send4 (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{const char $\ast$}]{buffer,  }\item[{unsigned}]{buflen,  }\item[{const \hyperlink{structipv4addr}{ipv4addr} $\ast$}]{ip,  }\item[{\hyperlink{group__ipv4_ga113bbf93f3b0011263ce519bb1ca7481}{ipv4port}}]{port }\end{DoxyParamCaption})}

Send a datagram on a U\+DP socket. 

References ipv4addr\+::addr.

\mbox{\label{group__socket_ga59f8b78cd870be6e55b0205ce69780b1}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+send6@{socket\+\_\+send6}}
\index{socket\+\_\+send6@{socket\+\_\+send6}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+send6()}{socket\_send6()}}
{\footnotesize\ttfamily int socket\+\_\+send6 (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{const char $\ast$}]{buffer,  }\item[{unsigned}]{buflen,  }\item[{const \hyperlink{structipv6addr}{ipv6addr} $\ast$}]{ip,  }\item[{\hyperlink{group__ipv6_gaa71ffb8f46cd4fa830090d23eb752847}{ipv6port}}]{port }\end{DoxyParamCaption})}

Send a datagram on an I\+Pv6 U\+DP socket. 

References ipv6addr\+::addr.

\mbox{\label{group__socket_ga0b2ab1619356b51c379c3b3cfd047bf9}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+sendfd@{socket\+\_\+sendfd}}
\index{socket\+\_\+sendfd@{socket\+\_\+sendfd}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+sendfd()}{socket\_sendfd()}}
{\footnotesize\ttfamily int socket\+\_\+sendfd (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{int}]{fd }\end{DoxyParamCaption})}

Send a file descriptor over a socket. \mbox{\label{group__socket_ga2e1e867a59f55178bd91943937be27e8}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+sendu@{socket\+\_\+sendu}}
\index{socket\+\_\+sendu@{socket\+\_\+sendu}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+sendu()}{socket\_sendu()}}
{\footnotesize\ttfamily int socket\+\_\+sendu (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{const char $\ast$}]{buffer,  }\item[{unsigned}]{buflen }\end{DoxyParamCaption})}

Send a datagram on a U\+N\+IX domain socket. \mbox{\label{group__socket_gac91dfda7ec1b043b277fdcd205eb79e8}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+shutdown@{socket\+\_\+shutdown}}
\index{socket\+\_\+shutdown@{socket\+\_\+shutdown}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+shutdown()}{socket\_shutdown()}}
{\footnotesize\ttfamily int socket\+\_\+shutdown (\begin{DoxyParamCaption}\item[{int}]{sock,  }\item[{int}]{shut\+\_\+rd,  }\item[{int}]{shut\+\_\+wr }\end{DoxyParamCaption})}

Shut down part or all of a socket. \mbox{\label{group__socket_ga88d576380c2025501e9a8266bcddc759}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+tcp@{socket\+\_\+tcp}}
\index{socket\+\_\+tcp@{socket\+\_\+tcp}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+tcp()}{socket\_tcp()}}
{\footnotesize\ttfamily int socket\+\_\+tcp (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}

Create a T\+C\+P/\+IP socket. 

References socket\+\_\+tcp4().



Referenced by dns\+\_\+transmit\+\_\+free().

\mbox{\label{group__socket_gac3ff4662c65f65784534be54ef73a5c1}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+tcp4@{socket\+\_\+tcp4}}
\index{socket\+\_\+tcp4@{socket\+\_\+tcp4}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+tcp4()}{socket\_tcp4()}}
{\footnotesize\ttfamily int socket\+\_\+tcp4 (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}

Create a T\+C\+P/\+I\+Pv4 socket. 

Referenced by socket\+\_\+connect4(), and socket\+\_\+tcp().

\mbox{\label{group__socket_gaa40101a7969252728f0f29a7b40afbb0}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+tcp6@{socket\+\_\+tcp6}}
\index{socket\+\_\+tcp6@{socket\+\_\+tcp6}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+tcp6()}{socket\_tcp6()}}
{\footnotesize\ttfamily int socket\+\_\+tcp6 (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}

Create a T\+C\+P/\+I\+Pv6 socket. \mbox{\label{group__socket_gaaa146f612229109460767f7b33264436}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+udp@{socket\+\_\+udp}}
\index{socket\+\_\+udp@{socket\+\_\+udp}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+udp()}{socket\_udp()}}
{\footnotesize\ttfamily int socket\+\_\+udp (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}

Create a U\+D\+P/\+IP socket. 

References socket\+\_\+udp4().



Referenced by dns\+\_\+transmit\+\_\+free().

\mbox{\label{group__socket_ga6f5bd2aa2b03be301bdd402a96d8c1cc}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+udp4@{socket\+\_\+udp4}}
\index{socket\+\_\+udp4@{socket\+\_\+udp4}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+udp4()}{socket\_udp4()}}
{\footnotesize\ttfamily int socket\+\_\+udp4 (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}

Create a U\+D\+P/\+I\+Pv4 socket. 

Referenced by socket\+\_\+udp().

\mbox{\label{group__socket_ga97257e7446c72c21b3b80b56efae5114}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+udp6@{socket\+\_\+udp6}}
\index{socket\+\_\+udp6@{socket\+\_\+udp6}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+udp6()}{socket\_udp6()}}
{\footnotesize\ttfamily int socket\+\_\+udp6 (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}

Create a U\+D\+P/\+I\+Pv6 socket. \mbox{\label{group__socket_gae754518918db3d63dda03d9fd7497f24}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+uncork@{socket\+\_\+uncork}}
\index{socket\+\_\+uncork@{socket\+\_\+uncork}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+uncork()}{socket\_uncork()}}
{\footnotesize\ttfamily int socket\+\_\+uncork (\begin{DoxyParamCaption}\item[{int}]{sock }\end{DoxyParamCaption})}

Unstop a T\+CP socket from sending short writes. \mbox{\label{group__socket_ga3c74e521debc5d71da6cb975c24f5a6f}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+unixdgm@{socket\+\_\+unixdgm}}
\index{socket\+\_\+unixdgm@{socket\+\_\+unixdgm}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+unixdgm()}{socket\_unixdgm()}}
{\footnotesize\ttfamily int socket\+\_\+unixdgm (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}

Create U\+N\+IX domain datagram socket. \mbox{\label{group__socket_ga8d8f154af4bc27c718676848aeca4517}} 
\index{socket\+: General socket manipulations@{socket\+: General socket manipulations}!socket\+\_\+unixstr@{socket\+\_\+unixstr}}
\index{socket\+\_\+unixstr@{socket\+\_\+unixstr}!socket\+: General socket manipulations@{socket\+: General socket manipulations}}
\subsubsection{\texorpdfstring{socket\+\_\+unixstr()}{socket\_unixstr()}}
{\footnotesize\ttfamily int socket\+\_\+unixstr (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}

Create U\+N\+IX domain stream socket. 