Sophie

Sophie

distrib > Mandriva > 2007.0 > i586 > by-pkgid > ad1ba1135a9c9eeffc2e538163e00373 > files > 755

libCommonC++2_1.4-devel-1.4.1-1mdv2007.0.i586.rpm

\section{ost::Socket Class Reference}
\label{classost_1_1_socket}\index{ost::Socket@{ost::Socket}}
The {\bf Socket}{\rm (p.\,\pageref{classost_1_1_socket})} is used as the base for all Internet protocol services under Common C++.base class of all sockets.  


{\tt \#include $<$socket.h$>$}

Inheritance diagram for ost::Socket::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=9cm]{classost_1_1_socket}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
typedef enum {\bf Family} {\bf Family}
\item 
typedef enum {\bf Error} {\bf Error}
\item 
typedef enum {\bf Tos} {\bf Tos}
\item 
typedef enum {\bf Pending} {\bf Pending}
\item 
enum {\bf Family} \{ {\bf IPV6} =  AF\_\-INET6, 
{\bf IPV4} =  AF\_\-INET
 \}
\item 
enum {\bf Error} \{ \par
{\bf err\-Success} =  0, 
{\bf err\-Create\-Failed}, 
{\bf err\-Copy\-Failed}, 
{\bf err\-Input}, 
\par
{\bf err\-Input\-Interrupt}, 
{\bf err\-Resource\-Failure}, 
{\bf err\-Output}, 
{\bf err\-Output\-Interrupt}, 
\par
{\bf err\-Not\-Connected}, 
{\bf err\-Connect\-Refused}, 
{\bf err\-Connect\-Rejected}, 
{\bf err\-Connect\-Timeout}, 
\par
{\bf err\-Connect\-Failed}, 
{\bf err\-Connect\-Invalid}, 
{\bf err\-Connect\-Busy}, 
{\bf err\-Connect\-No\-Route}, 
\par
{\bf err\-Binding\-Failed}, 
{\bf err\-Broadcast\-Denied}, 
{\bf err\-Routing\-Denied}, 
{\bf err\-Keepalive\-Denied}, 
\par
{\bf err\-Service\-Denied}, 
{\bf err\-Service\-Unavailable}, 
{\bf err\-Multicast\-Disabled}, 
{\bf err\-Timeout}, 
\par
{\bf err\-No\-Delay}, 
{\bf err\-Extended}, 
{\bf err\-Lookup\-Fail}, 
{\bf err\-Search\-Err}, 
\par
{\bf err\-Invalid\-Value}
 \}
\item 
enum {\bf Tos} \{ \par
{\bf tos\-Low\-Delay} =  0, 
{\bf tos\-Throughput}, 
{\bf tos\-Reliability}, 
{\bf tos\-Min\-Cost}, 
\par
{\bf tos\-Invalid}
 \}
\item 
enum {\bf Pending} \{ {\bf pending\-Input}, 
{\bf pending\-Output}, 
{\bf pending\-Error}
 \}
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
virtual {\bf $\sim$Socket} ()
\begin{CompactList}\small\item\em The socket base class may be \char`\"{}thrown\char`\"{} as a result of an error, and the \char`\"{}catcher\char`\"{} may then choose to destroy the object. \item\end{CompactList}\item 
{\bf Socket} \& {\bf operator=} (const {\bf Socket} \&from)
\begin{CompactList}\small\item\em Sockets may also be duplicated by the assignment operator. \item\end{CompactList}\item 
{\bf IPV4Host} {\bf get\-IPV4Sender} ({\bf tpport\_\-t} $\ast$port=NULL) const 
\begin{CompactList}\small\item\em May be used to examine the origin of data waiting in the socket receive queue. \item\end{CompactList}\item 
{\bf IPV4Host} {\bf get\-Sender} ({\bf tpport\_\-t} $\ast$port=NULL) const 
\item 
{\bf IPV6Host} {\bf get\-IPV6Sender} ({\bf tpport\_\-t} $\ast$port=NULL) const 
\item 
{\bf IPV4Host} {\bf get\-IPV4Peer} ({\bf tpport\_\-t} $\ast$port=NULL) const 
\begin{CompactList}\small\item\em Get the host address and port of the socket this socket is connected to. \item\end{CompactList}\item 
{\bf IPV4Host} {\bf get\-Peer} ({\bf tpport\_\-t} $\ast$port=NULL) const 
\item 
{\bf IPV6Host} {\bf get\-IPV6Peer} ({\bf tpport\_\-t} $\ast$port=NULL) const 
\item 
{\bf IPV4Host} {\bf get\-IPV4Local} ({\bf tpport\_\-t} $\ast$port=NULL) const 
\begin{CompactList}\small\item\em Get the local address and port number this socket is currently bound to. \item\end{CompactList}\item 
{\bf IPV4Host} {\bf get\-Local} ({\bf tpport\_\-t} $\ast$port=NULL) const 
\item 
{\bf IPV6Host} {\bf get\-IPV6Local} ({\bf tpport\_\-t} $\ast$port=NULL) const 
\item 
{\bf IPV4Host} {\bf get\-IPV4NAT} ({\bf tpport\_\-t} $\ast$port=NULL) const 
\begin{CompactList}\small\item\em Perform NAT table lookup for this socket. \item\end{CompactList}\item 
{\bf IPV4Host} {\bf get\-NAT} ({\bf tpport\_\-t} $\ast$port) const 
\item 
{\bf IPV6Host} {\bf get\-IPV6NAT} ({\bf tpport\_\-t} $\ast$port=NULL) const 
\item 
void {\bf set\-Completion} (bool immediate)
\begin{CompactList}\small\item\em Used to specify blocking mode for the socket. \item\end{CompactList}\item 
{\bf Error} {\bf set\-Linger} (bool {\bf linger})
\begin{CompactList}\small\item\em Enable lingering sockets on close. \item\end{CompactList}\item 
{\bf Error} {\bf set\-Keep\-Alive} (bool enable)
\begin{CompactList}\small\item\em Set the keep-alive status of this socket and if keep-alive messages will be sent. \item\end{CompactList}\item 
{\bf Error} {\bf set\-Type\-Of\-Service} ({\bf Tos} service)
\begin{CompactList}\small\item\em Set packet scheduling on platforms which support ip quality of service conventions. \item\end{CompactList}\item 
bool {\bf is\-Connected} (void) const 
\begin{CompactList}\small\item\em Can test to see if this socket is \char`\"{}connected\char`\"{}, and hence whether a \char`\"{}catch\char`\"{} can safely call {\bf get\-Peer()}{\rm (p.\,\pageref{classost_1_1_socket_6fd1dffdfe9606e56fba838559ff6d67})}. \item\end{CompactList}\item 
bool {\bf is\-Active} (void) const 
\begin{CompactList}\small\item\em Test to see if the socket is at least operating or if it is mearly initialized. \item\end{CompactList}\item 
bool {\bf operator!} () const 
\begin{CompactList}\small\item\em Operator based testing to see if a socket is currently active. \item\end{CompactList}\item 
bool {\bf is\-Broadcast} (void) const 
\begin{CompactList}\small\item\em Return if broadcast has been enabled for the specified socket. \item\end{CompactList}\item 
bool {\bf is\-Routed} (void) const 
\begin{CompactList}\small\item\em Return if socket routing is enabled. \item\end{CompactList}\item 
{\bf Error} {\bf get\-Error\-Number} (void) const 
\begin{CompactList}\small\item\em Often used by a \char`\"{}catch\char`\"{} to fetch the last error of a thrown socket. \item\end{CompactList}\item 
const char $\ast$ {\bf get\-Error\-String} (void) const 
\begin{CompactList}\small\item\em Often used by a \char`\"{}catch\char`\"{} to fetch the user set error string of a thrown socket, but only if EXTENDED error codes are used. \item\end{CompactList}\item 
long {\bf get\-System\-Error} (void) const 
\item 
const char $\ast$ {\bf get\-System\-Error\-String} (void) const 
\item 
virtual bool {\bf is\-Pending} ({\bf Pending} pend, {\bf timeout\_\-t} timeout=TIMEOUT\_\-INF)
\begin{CompactList}\small\item\em Get the status of pending operations. \item\end{CompactList}\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static bool {\bf check} ({\bf Family} fam)
\begin{CompactList}\small\item\em See if a specific protocol family is available in the current runtime environment. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Types}
\begin{CompactItemize}
\item 
typedef enum {\bf State} {\bf State}
\item 
enum {\bf State} \{ \par
{\bf INITIAL}, 
{\bf AVAILABLE}, 
{\bf BOUND}, 
{\bf CONNECTED}, 
\par
{\bf CONNECTING}, 
{\bf STREAM}
 \}
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
{\bf Error} {\bf error} ({\bf Error} error, char $\ast$err=NULL, long system\-Error=0) const 
\begin{CompactList}\small\item\em This service is used to throw all socket errors which usually occur during the socket constructor. \item\end{CompactList}\item 
void {\bf error} (char $\ast$err) const 
\begin{CompactList}\small\item\em This service is used to throw application defined socket errors where the application specific error code is a string. \item\end{CompactList}\item 
void {\bf set\-Error} (bool enable)
\begin{CompactList}\small\item\em This service is used to turn the error handler on or off for \char`\"{}throwing\char`\"{} exceptions by manipulating the thrown flag. \item\end{CompactList}\item 
void {\bf end\-Socket} (void)
\begin{CompactList}\small\item\em Used as the default destructor for ending a socket. \item\end{CompactList}\item 
{\bf Error} {\bf connect\-Error} (void)
\begin{CompactList}\small\item\em Used as a common handler for connection failure processing. \item\end{CompactList}\item 
{\bf Error} {\bf send\-Limit} (int limit=2048)
\begin{CompactList}\small\item\em Set the send limit. \item\end{CompactList}\item 
{\bf Error} {\bf receive\-Limit} (int limit=1)
\begin{CompactList}\small\item\em Set thr receive limit. \item\end{CompactList}\item 
{\bf Error} {\bf send\-Timeout} ({\bf timeout\_\-t} timer)
\begin{CompactList}\small\item\em Set the send timeout for sending raw network data. \item\end{CompactList}\item 
{\bf Error} {\bf receive\-Timeout} ({\bf timeout\_\-t} timer)
\begin{CompactList}\small\item\em Receive timeout for receiving raw network data. \item\end{CompactList}\item 
{\bf Error} {\bf send\-Buffer} (unsigned size)
\begin{CompactList}\small\item\em Set the protocol stack network kernel send buffer size associated with the socket. \item\end{CompactList}\item 
{\bf Error} {\bf receive\-Buffer} (unsigned size)
\begin{CompactList}\small\item\em Set the protocol stack network kernel receive buffer size associated with the socket. \item\end{CompactList}\item 
{\bf Error} {\bf buffer\-Size} (unsigned size)
\begin{CompactList}\small\item\em Set the total protocol stack network kernel buffer size for both send and receive together. \item\end{CompactList}\item 
{\bf Error} {\bf set\-Broadcast} (bool enable)
\begin{CompactList}\small\item\em Set the subnet broadcast flag for the socket. \item\end{CompactList}\item 
{\bf Error} {\bf set\-Multicast\-By\-Family} (bool enable, {\bf Family} family=IPV4)
\begin{CompactList}\small\item\em Setting multicast binds the multicast interface used for the socket to the interface the socket itself has been implicitly bound to. \item\end{CompactList}\item 
{\bf Error} {\bf set\-Loopback\-By\-Family} (bool enable, {\bf Family} family=IPV4)
\begin{CompactList}\small\item\em Set the multicast loopback flag for the socket. \item\end{CompactList}\item 
{\bf Error} {\bf set\-Time\-To\-Live\-By\-Family} (unsigned char {\bf ttl}, {\bf Family} fam=IPV4)
\begin{CompactList}\small\item\em Set the multicast time to live for a multicast socket. \item\end{CompactList}\item 
{\bf Error} {\bf join} (const {\bf IPV4Multicast} \&ia)
\begin{CompactList}\small\item\em Join a multicast group. \item\end{CompactList}\item 
{\bf Error} {\bf join} (const {\bf IPV6Multicast} \&ia)
\item 
{\bf Error} {\bf drop} (const {\bf IPV4Multicast} \&ia)
\begin{CompactList}\small\item\em Drop membership from a multicast group. \item\end{CompactList}\item 
{\bf Error} {\bf drop} (const {\bf IPV6Multicast} \&ia)
\item 
{\bf Error} {\bf set\-Routing} (bool enable)
\begin{CompactList}\small\item\em Set the socket routing to indicate if outgoing messages should bypass normal routing (set false). \item\end{CompactList}\item 
{\bf Error} {\bf set\-No\-Delay} (bool enable)
\begin{CompactList}\small\item\em Enable/disable delaying packets (Nagle algorithm). \item\end{CompactList}\item 
{\bf Socket} (int domain, int type, int protocol=0)
\begin{CompactList}\small\item\em An unconnected socket may be created directly on the local machine. \item\end{CompactList}\item 
{\bf Socket} ({\bf SOCKET} fd)
\begin{CompactList}\small\item\em A socket object may be created from a file descriptor when that descriptor was created either through a socket() or accept() call. \item\end{CompactList}\item 
{\bf Socket} ()
\begin{CompactList}\small\item\em Create an inactive socket object for base constructors. \item\end{CompactList}\item 
{\bf Socket} (const {\bf Socket} \&source)
\begin{CompactList}\small\item\em A socket can also be constructed from an already existing {\bf Socket}{\rm (p.\,\pageref{classost_1_1_socket})} object. \item\end{CompactList}\item 
ssize\_\-t {\bf read\-Line} (char $\ast$buf, size\_\-t len, {\bf timeout\_\-t} timeout=0)
\begin{CompactList}\small\item\em {\bf Process}{\rm (p.\,\pageref{classost_1_1_process})} a logical input line from a socket descriptor directly. \item\end{CompactList}\item 
virtual ssize\_\-t {\bf read\-Data} (void $\ast$buf, size\_\-t len, char separator=0, {\bf timeout\_\-t} t=0)
\begin{CompactList}\small\item\em Read in a block of len bytes with specific separator. \item\end{CompactList}\item 
virtual ssize\_\-t {\bf write\-Data} (const void $\ast$buf, size\_\-t len, {\bf timeout\_\-t} t=0)
\begin{CompactList}\small\item\em Write a block of len bytes to socket. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
\begin{tabbing}
xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=\kill
struct \{\\
\>bool {\bf thrown}: 1\\
\>bool {\bf broadcast}: 1\\
\>bool {\bf route}: 1\\
\>bool {\bf keepalive}: 1\\
\>bool {\bf loopback}: 1\\
\>bool {\bf multicast}: 1\\
\>bool {\bf completion}: 1\\
\>bool {\bf linger}: 1\\
\>unsigned {\bf ttl}: 8\\
\} {\bf flags}\\

\end{tabbing}\item 
{\bf SOCKET} volatile {\bf so}
\begin{CompactList}\small\item\em the actual socket descriptor, in Windows, unlike posix it $\ast$cannot$\ast$ be used as an file descriptor that way madness lies -- jfc \item\end{CompactList}\item 
{\bf State} volatile {\bf state}
\end{CompactItemize}
\subsection*{Static Protected Attributes}
\begin{CompactItemize}
\item 
static {\bf Mutex} {\bf mutex}
\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
{\bf SOCKET} {\bf dup\-Socket} ({\bf SOCKET} s, {\bf Socket::State} {\bf state})
\end{CompactItemize}


\subsection{Detailed Description}
The {\bf Socket}{\rm (p.\,\pageref{classost_1_1_socket})} is used as the base for all Internet protocol services under Common C++.base class of all sockets. 

A socket is a system resource (or winsock descriptor) that occupies a specific port address (and may be bound to a specific network interface) on the local machine. The socket may also be directly connected to a specific socket on a remote internet host.

This base class is not directly used, but is provided to offer properties common to other Common C++ socket classes, including the socket exception model and the ability to set socket properties such as Qo\-S, \char`\"{}sockopts\char`\"{} properties like Dont-Route and Keep-Alive, etc.

\begin{Desc}
\item[Author:]David Sugar $<${\tt dyfet@ostel.com}$>$ \end{Desc}




\subsection{Member Typedef Documentation}
\index{ost::Socket@{ost::Socket}!Error@{Error}}
\index{Error@{Error}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef enum {\bf Error} {\bf ost::Socket::Error}}\label{classost_1_1_socket_3306a277326459f69aa69b474f50d6e2}




Reimplemented in {\bf ost::URLStream} {\rm (p.\,\pageref{classost_1_1_u_r_l_stream_3cbe53f1c34d7fdbd73efa61edbf463d})}.\index{ost::Socket@{ost::Socket}!Family@{Family}}
\index{Family@{Family}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef enum {\bf Family} {\bf ost::Socket::Family}}\label{classost_1_1_socket_aa032e41b920b38a79c875b8ae375799}


\index{ost::Socket@{ost::Socket}!Pending@{Pending}}
\index{Pending@{Pending}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef enum {\bf Pending} {\bf ost::Socket::Pending}}\label{classost_1_1_socket_c2fe3b8bf4dfc66c7df11dfa1ce4415c}


\index{ost::Socket@{ost::Socket}!State@{State}}
\index{State@{State}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef enum {\bf State} {\bf ost::Socket::State}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_c8890572886dca1a03a775997f04abba}


\index{ost::Socket@{ost::Socket}!Tos@{Tos}}
\index{Tos@{Tos}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef enum {\bf Tos} {\bf ost::Socket::Tos}}\label{classost_1_1_socket_7caa0e1bb24b387bd1c5b8240ea592e1}




\subsection{Member Enumeration Documentation}
\index{ost::Socket@{ost::Socket}!Error@{Error}}
\index{Error@{Error}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf ost::Socket::Error}}\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3f}


\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{errSuccess@{errSuccess}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errSuccess@{errSuccess}}\item[{\em 
err\-Success\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3f706ac48f0deba4e591d9668ea79962e8}
}]\index{errCreateFailed@{errCreateFailed}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errCreateFailed@{errCreateFailed}}\item[{\em 
err\-Create\-Failed\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3f8d1d01d77a141c804b50456d70b94e46}
}]\index{errCopyFailed@{errCopyFailed}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errCopyFailed@{errCopyFailed}}\item[{\em 
err\-Copy\-Failed\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3f394bc212b3ab9c69dcb47b1412cedb53}
}]\index{errInput@{errInput}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errInput@{errInput}}\item[{\em 
err\-Input\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3fa5b3fc41be74d485b9aca2af43d27424}
}]\index{errInputInterrupt@{errInputInterrupt}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errInputInterrupt@{errInputInterrupt}}\item[{\em 
err\-Input\-Interrupt\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3fc1c33a97e722515f9851b116dc7bf2c5}
}]\index{errResourceFailure@{errResourceFailure}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errResourceFailure@{errResourceFailure}}\item[{\em 
err\-Resource\-Failure\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3f5833cd0e1a43ae7d420e62ce0851611e}
}]\index{errOutput@{errOutput}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errOutput@{errOutput}}\item[{\em 
err\-Output\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3f1c7ee1231e7e7f8e8b6b1447d6f15090}
}]\index{errOutputInterrupt@{errOutputInterrupt}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errOutputInterrupt@{errOutputInterrupt}}\item[{\em 
err\-Output\-Interrupt\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3ff67d1bcf85481bc4dd222f91e92deeb4}
}]\index{errNotConnected@{errNotConnected}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errNotConnected@{errNotConnected}}\item[{\em 
err\-Not\-Connected\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3f672dcab0341a211dcb14e0f848e9b5f9}
}]\index{errConnectRefused@{errConnectRefused}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errConnectRefused@{errConnectRefused}}\item[{\em 
err\-Connect\-Refused\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3fde54564fcb05a1744ccbf94f5a1b57a5}
}]\index{errConnectRejected@{errConnectRejected}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errConnectRejected@{errConnectRejected}}\item[{\em 
err\-Connect\-Rejected\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3f837e20c1c3c6cf12d670f87afc1e8f66}
}]\index{errConnectTimeout@{errConnectTimeout}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errConnectTimeout@{errConnectTimeout}}\item[{\em 
err\-Connect\-Timeout\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3ff1a03fa32f971b5077ebf1cf749e90fa}
}]\index{errConnectFailed@{errConnectFailed}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errConnectFailed@{errConnectFailed}}\item[{\em 
err\-Connect\-Failed\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3f7646955354dce1249d606a2369ea6eaa}
}]\index{errConnectInvalid@{errConnectInvalid}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errConnectInvalid@{errConnectInvalid}}\item[{\em 
err\-Connect\-Invalid\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3f1629a51edc39b379b3736a07d07bd782}
}]\index{errConnectBusy@{errConnectBusy}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errConnectBusy@{errConnectBusy}}\item[{\em 
err\-Connect\-Busy\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3fd21ca357b1645094f6ddcbac26a4deed}
}]\index{errConnectNoRoute@{errConnectNoRoute}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errConnectNoRoute@{errConnectNoRoute}}\item[{\em 
err\-Connect\-No\-Route\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3f42e56e9bcd983284be704de1400d991d}
}]\index{errBindingFailed@{errBindingFailed}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errBindingFailed@{errBindingFailed}}\item[{\em 
err\-Binding\-Failed\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3f61d62014cda69b8d77dd07141f59252b}
}]\index{errBroadcastDenied@{errBroadcastDenied}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errBroadcastDenied@{errBroadcastDenied}}\item[{\em 
err\-Broadcast\-Denied\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3fc3609d1255c9a57b86edc1c9a9a79e42}
}]\index{errRoutingDenied@{errRoutingDenied}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errRoutingDenied@{errRoutingDenied}}\item[{\em 
err\-Routing\-Denied\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3fa352506dcb7b1d118837c1808944466f}
}]\index{errKeepaliveDenied@{errKeepaliveDenied}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errKeepaliveDenied@{errKeepaliveDenied}}\item[{\em 
err\-Keepalive\-Denied\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3f4e60741a75df84410263a3113090f55a}
}]\index{errServiceDenied@{errServiceDenied}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errServiceDenied@{errServiceDenied}}\item[{\em 
err\-Service\-Denied\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3f6a5e613ed6f8b222d924e419943a870c}
}]\index{errServiceUnavailable@{errServiceUnavailable}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errServiceUnavailable@{errServiceUnavailable}}\item[{\em 
err\-Service\-Unavailable\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3f4739d2c04636eff1971b3648bda5f672}
}]\index{errMulticastDisabled@{errMulticastDisabled}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errMulticastDisabled@{errMulticastDisabled}}\item[{\em 
err\-Multicast\-Disabled\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3f8753eb8cc4591d5288c72ba2c91ea956}
}]\index{errTimeout@{errTimeout}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errTimeout@{errTimeout}}\item[{\em 
err\-Timeout\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3f5d0c869dc200b3cd1eab866816dc217a}
}]\index{errNoDelay@{errNoDelay}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errNoDelay@{errNoDelay}}\item[{\em 
err\-No\-Delay\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3ffe1fd02e79a208ee781a5b41f7fb5814}
}]\index{errExtended@{errExtended}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errExtended@{errExtended}}\item[{\em 
err\-Extended\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3f8f699326e6567ea4171d5821fa417e35}
}]\index{errLookupFail@{errLookupFail}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errLookupFail@{errLookupFail}}\item[{\em 
err\-Lookup\-Fail\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3f337bdb7f7512963ef0354f8be541c71e}
}]\index{errSearchErr@{errSearchErr}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errSearchErr@{errSearchErr}}\item[{\em 
err\-Search\-Err\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3f8939131de2df58fc2327933cbd024e49}
}]\index{errInvalidValue@{errInvalidValue}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!errInvalidValue@{errInvalidValue}}\item[{\em 
err\-Invalid\-Value\label{classost_1_1_socket_e056b6dd4f167163083b7ab602fd3f3f9ede2afac3c4df2fd5671d48cbf546dc}
}]\end{description}
\end{Desc}



Reimplemented in {\bf ost::URLStream} {\rm (p.\,\pageref{classost_1_1_u_r_l_stream_3cbe53f1c34d7fdbd73efa61edbf463d})}.\index{ost::Socket@{ost::Socket}!Family@{Family}}
\index{Family@{Family}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf ost::Socket::Family}}\label{classost_1_1_socket_36a69681caa020f1abed34ae71d206ef}


\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{IPV6@{IPV6}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!IPV6@{IPV6}}\item[{\em 
IPV6\label{classost_1_1_socket_36a69681caa020f1abed34ae71d206efe49b01941932c262f6fbbc8e21d3340d}
}]\index{IPV4@{IPV4}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!IPV4@{IPV4}}\item[{\em 
IPV4\label{classost_1_1_socket_36a69681caa020f1abed34ae71d206ef5bd9a46a5c0f46815c98feeb02e5e926}
}]\end{description}
\end{Desc}

\index{ost::Socket@{ost::Socket}!Pending@{Pending}}
\index{Pending@{Pending}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf ost::Socket::Pending}}\label{classost_1_1_socket_2cb9ccad21fc2f10c23e45cbb99bc6f8}


\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{pendingInput@{pendingInput}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!pendingInput@{pendingInput}}\item[{\em 
pending\-Input\label{classost_1_1_socket_2cb9ccad21fc2f10c23e45cbb99bc6f8f2d41647f208c78eb97fe77196c55ccc}
}]\index{pendingOutput@{pendingOutput}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!pendingOutput@{pendingOutput}}\item[{\em 
pending\-Output\label{classost_1_1_socket_2cb9ccad21fc2f10c23e45cbb99bc6f80c9ffb2c87eb616774ea812fc9739efd}
}]\index{pendingError@{pendingError}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!pendingError@{pendingError}}\item[{\em 
pending\-Error\label{classost_1_1_socket_2cb9ccad21fc2f10c23e45cbb99bc6f8d3bac41d6ea72956235766139b8742d6}
}]\end{description}
\end{Desc}

\index{ost::Socket@{ost::Socket}!State@{State}}
\index{State@{State}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf ost::Socket::State}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_d17e0a386f4c50a57db3bebe55571066}


\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{INITIAL@{INITIAL}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!INITIAL@{INITIAL}}\item[{\em 
INITIAL\label{classost_1_1_socket_d17e0a386f4c50a57db3bebe55571066bd827e310a97ea890353a7ee5f92885c}
}]\index{AVAILABLE@{AVAILABLE}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!AVAILABLE@{AVAILABLE}}\item[{\em 
AVAILABLE\label{classost_1_1_socket_d17e0a386f4c50a57db3bebe555710669181006b79c1fc5111fa9fd8adced04d}
}]\index{BOUND@{BOUND}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!BOUND@{BOUND}}\item[{\em 
BOUND\label{classost_1_1_socket_d17e0a386f4c50a57db3bebe555710666f74458d0045b716df163290d56a5c85}
}]\index{CONNECTED@{CONNECTED}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!CONNECTED@{CONNECTED}}\item[{\em 
CONNECTED\label{classost_1_1_socket_d17e0a386f4c50a57db3bebe55571066421a6e01dfd1841341d0dbcd7e821aa6}
}]\index{CONNECTING@{CONNECTING}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!CONNECTING@{CONNECTING}}\item[{\em 
CONNECTING\label{classost_1_1_socket_d17e0a386f4c50a57db3bebe555710668240e96a84fba05c787ee8f770bbc47d}
}]\index{STREAM@{STREAM}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!STREAM@{STREAM}}\item[{\em 
STREAM\label{classost_1_1_socket_d17e0a386f4c50a57db3bebe55571066f623db6499fd0e2eca13da3c94048fd0}
}]\end{description}
\end{Desc}

\index{ost::Socket@{ost::Socket}!Tos@{Tos}}
\index{Tos@{Tos}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf ost::Socket::Tos}}\label{classost_1_1_socket_258f81f5a42d051242f0f49f8192f890}


\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{tosLowDelay@{tosLowDelay}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!tosLowDelay@{tosLowDelay}}\item[{\em 
tos\-Low\-Delay\label{classost_1_1_socket_258f81f5a42d051242f0f49f8192f8902199fbf8a1e891120f27a67559e9b6ff}
}]\index{tosThroughput@{tosThroughput}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!tosThroughput@{tosThroughput}}\item[{\em 
tos\-Throughput\label{classost_1_1_socket_258f81f5a42d051242f0f49f8192f890e805c8e2bc547dbc94b32ccc19c1396b}
}]\index{tosReliability@{tosReliability}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!tosReliability@{tosReliability}}\item[{\em 
tos\-Reliability\label{classost_1_1_socket_258f81f5a42d051242f0f49f8192f890d0e7d077cb9c6e6f3e702bc735af87d4}
}]\index{tosMinCost@{tosMinCost}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!tosMinCost@{tosMinCost}}\item[{\em 
tos\-Min\-Cost\label{classost_1_1_socket_258f81f5a42d051242f0f49f8192f890ed0323ec6ea800b824853441c4ccd3e8}
}]\index{tosInvalid@{tosInvalid}!ost::Socket@{ost::Socket}}\index{ost::Socket@{ost::Socket}!tosInvalid@{tosInvalid}}\item[{\em 
tos\-Invalid\label{classost_1_1_socket_258f81f5a42d051242f0f49f8192f890c0b92a366fed8d304b3c91323aa49a15}
}]\end{description}
\end{Desc}



\subsection{Constructor \& Destructor Documentation}
\index{ost::Socket@{ost::Socket}!Socket@{Socket}}
\index{Socket@{Socket}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Socket::Socket (int {\em domain}, int {\em type}, int {\em protocol} = {\tt 0})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_80235ff77955cff4f3b44dfcd4546939}


An unconnected socket may be created directly on the local machine. 

Sockets can occupy both the internet domain (AF\_\-INET) and UNIX socket domain (AF\_\-UNIX) under unix. The socket type (SOCK\_\-STREAM, SOCK\_\-DGRAM) and protocol may also be specified. If the socket cannot be created, an exception is thrown.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em domain}]socket domain to use. \item[{\em type}]base type and protocol family of the socket. \item[{\em protocol}]specific protocol to apply. \end{description}
\end{Desc}
\index{ost::Socket@{ost::Socket}!Socket@{Socket}}
\index{Socket@{Socket}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Socket::Socket ({\bf SOCKET} {\em fd})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_b626d95fcde74c4e1f1ba1da49b941fb}


A socket object may be created from a file descriptor when that descriptor was created either through a socket() or accept() call. 

This constructor is mostly for internal use.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fd}]file descriptor of an already existing socket. \end{description}
\end{Desc}
\index{ost::Socket@{ost::Socket}!Socket@{Socket}}
\index{Socket@{Socket}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Socket::Socket ()\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_eda9b71324d761b3e6ac45c25613d048}


Create an inactive socket object for base constructors. 

\index{ost::Socket@{ost::Socket}!Socket@{Socket}}
\index{Socket@{Socket}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Socket::Socket (const {\bf Socket} \& {\em source})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_cc82106055495c1b464755807b622689}


A socket can also be constructed from an already existing {\bf Socket}{\rm (p.\,\pageref{classost_1_1_socket})} object. 

On POSIX systems, the socket file descriptor is dup()'d. On Win32, Duplicate\-Handle() is used.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em source}]of existing socket to clone. \end{description}
\end{Desc}
\index{ost::Socket@{ost::Socket}!~Socket@{$\sim$Socket}}
\index{~Socket@{$\sim$Socket}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ost::Socket::$\sim$Socket ()\hspace{0.3cm}{\tt  [virtual]}}\label{classost_1_1_socket_801b3892635919626d7fc8f3d03da933}


The socket base class may be \char`\"{}thrown\char`\"{} as a result of an error, and the \char`\"{}catcher\char`\"{} may then choose to destroy the object. 

By assuring the socket base class is a virtual destructor, we can assure the full object is properly terminated. 

\subsection{Member Function Documentation}
\index{ost::Socket@{ost::Socket}!bufferSize@{bufferSize}}
\index{bufferSize@{bufferSize}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::buffer\-Size (unsigned {\em size})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_dbc655480acedfcc5febdd28631f0fa7}


Set the total protocol stack network kernel buffer size for both send and receive together. 

\begin{Desc}
\item[Returns:]err\-Success on success \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em size}]of buffer. \end{description}
\end{Desc}
\index{ost::Socket@{ost::Socket}!check@{check}}
\index{check@{check}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static bool ost::Socket::check ({\bf Family} {\em fam})\hspace{0.3cm}{\tt  [static]}}\label{classost_1_1_socket_f735f45763298ad70b9925518b795837}


See if a specific protocol family is available in the current runtime environment. 

\begin{Desc}
\item[Returns:]true if family available. \end{Desc}
\index{ost::Socket@{ost::Socket}!connectError@{connectError}}
\index{connectError@{connectError}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::connect\-Error (void)\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_217dc5ca83ea9fe3849bc34b6ee5253d}


Used as a common handler for connection failure processing. 

\begin{Desc}
\item[Returns:]correct failure code to apply. \end{Desc}
\index{ost::Socket@{ost::Socket}!drop@{drop}}
\index{drop@{drop}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::drop (const {\bf IPV6Multicast} \& {\em ia})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_54bb968bfe110dc65bd5d0fb4a47383d}




Reimplemented in {\bf ost::UDPReceive} {\rm (p.\,\pageref{classost_1_1_u_d_p_receive_4fb379f4df763e3726c8097d65d4c584})}.\index{ost::Socket@{ost::Socket}!drop@{drop}}
\index{drop@{drop}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::drop (const {\bf IPV4Multicast} \& {\em ia})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_c59c08e11070a1602352da5c54332d9e}


Drop membership from a multicast group. 

\begin{Desc}
\item[Returns:]0 (err\-Success) on success, else error code. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ia}]address of multicast group to drop. \end{description}
\end{Desc}


Reimplemented in {\bf ost::UDPReceive} {\rm (p.\,\pageref{classost_1_1_u_d_p_receive_6ec872d42da02ac13e3390f4ec6cb98d})}.\index{ost::Socket@{ost::Socket}!endSocket@{endSocket}}
\index{endSocket@{endSocket}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void ost::Socket::end\-Socket (void)\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_3ab340e773f0214eefcf66f588bcf174}


Used as the default destructor for ending a socket. 

This will cleanly terminate the socket connection. It is provided for use in derived virtual destructors. \index{ost::Socket@{ost::Socket}!error@{error}}
\index{error@{error}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void ost::Socket::error (char $\ast$ {\em err}) const\hspace{0.3cm}{\tt  [inline, protected]}}\label{classost_1_1_socket_ffe0b3cfd0ff7a2511e91a81a590fe66}


This service is used to throw application defined socket errors where the application specific error code is a string. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em err}]string or message to pass. \end{description}
\end{Desc}
\index{ost::Socket@{ost::Socket}!error@{error}}
\index{error@{error}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::error ({\bf Error} {\em error}, char $\ast$ {\em err} = {\tt NULL}, long {\em system\-Error} = {\tt 0}) const\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_02525cefdf512d6cbf058854c9c27968}


This service is used to throw all socket errors which usually occur during the socket constructor. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em error}]defined socket error id. \item[{\em err}]string or message to pass. \item[{\em system\-Error}]the system error\# that caused the error \end{description}
\end{Desc}
\index{ost::Socket@{ost::Socket}!getErrorNumber@{getErrorNumber}}
\index{getErrorNumber@{getErrorNumber}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::get\-Error\-Number (void) const\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_socket_bfdaefd24888f2d51089bdb31894286e}


Often used by a \char`\"{}catch\char`\"{} to fetch the last error of a thrown socket. 

\begin{Desc}
\item[Returns:]error number of Error error. \end{Desc}
\begin{Desc}
\item[Examples: ]\par
{\bf tcpthread.cpp}.\end{Desc}
\index{ost::Socket@{ost::Socket}!getErrorString@{getErrorString}}
\index{getErrorString@{getErrorString}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ ost::Socket::get\-Error\-String (void) const\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_socket_d1c8bb17f75cfe540853a871081bd9d0}


Often used by a \char`\"{}catch\char`\"{} to fetch the user set error string of a thrown socket, but only if EXTENDED error codes are used. 

\begin{Desc}
\item[Returns:]string for error message. \end{Desc}
\index{ost::Socket@{ost::Socket}!getIPV4Local@{getIPV4Local}}
\index{getIPV4Local@{getIPV4Local}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf IPV4Host} ost::Socket::get\-IPV4Local ({\bf tpport\_\-t} $\ast$ {\em port} = {\tt NULL}) const}\label{classost_1_1_socket_f72396adf4cac5113e722447e48b7916}


Get the local address and port number this socket is currently bound to. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em port}]ptr to port number on local host. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]host address of interface this socket is bound to. \end{Desc}
\index{ost::Socket@{ost::Socket}!getIPV4NAT@{getIPV4NAT}}
\index{getIPV4NAT@{getIPV4NAT}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf IPV4Host} ost::Socket::get\-IPV4NAT ({\bf tpport\_\-t} $\ast$ {\em port} = {\tt NULL}) const}\label{classost_1_1_socket_27574c4f148166ef8857975ba3cbb5a5}


Perform NAT table lookup for this socket. 

Used to allow an application to know the original ip:port pair the the client \char`\"{}thinks\char`\"{} it is connecting to. Used mostly to transparently impersonate a remote server/service.

On error, 0.0.0.0:0 is returned and one of the following error codes is set: err\-Service\-Unavailable - if nat is not supported on the current platform or if it was not compiled; err\-Lookup\-Fail - if the nat syscall failed for some reason (extended error code); err\-Search\-Err - if the socket does not have nat information (i.e. is not nated).

NAT lookup is supported on Net\-Filter for ipv4 and ipv6 (Linux), IPFilter for ipv4 (Solaris, $\ast$BSD except Open\-BSD, HP-UX, etc.) and Packet Filter for ipv4 and ipv6 (Open\-BSD). When using IPFilter or Packet Filter, the first NAT lookup must be performed as root (the NAT device is read only for root and is opened once, unless an error occurs). Permissions on the nat device may be changed to solve this.

\begin{Desc}
\item[Warning:]When using IPFilter and Packet Filter, application data model must be the same as the running kernel (32/64 bits).\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em port}]ptr to NATed port number on local host. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]NATed host address that this socket is related to. \end{Desc}
\index{ost::Socket@{ost::Socket}!getIPV4Peer@{getIPV4Peer}}
\index{getIPV4Peer@{getIPV4Peer}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf IPV4Host} ost::Socket::get\-IPV4Peer ({\bf tpport\_\-t} $\ast$ {\em port} = {\tt NULL}) const}\label{classost_1_1_socket_8c8d2cfd48c75b03dc776b38b1c095f7}


Get the host address and port of the socket this socket is connected to. 

If the socket is currently not in a connected state, then a host address of 0.0.0.0 is returned.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em port}]ptr to port number of remote socket. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]host address of remote socket. \end{Desc}


Reimplemented in {\bf ost::UDPSocket} {\rm (p.\,\pageref{classost_1_1_u_d_p_socket_a2d073bd4fa3c3f1c7b70629996c67f7})}.\index{ost::Socket@{ost::Socket}!getIPV4Sender@{getIPV4Sender}}
\index{getIPV4Sender@{getIPV4Sender}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf IPV4Host} ost::Socket::get\-IPV4Sender ({\bf tpport\_\-t} $\ast$ {\em port} = {\tt NULL}) const}\label{classost_1_1_socket_7853e912f214a1f6fd05b1335f460f35}


May be used to examine the origin of data waiting in the socket receive queue. 

This can tell a TCP server where pending \char`\"{}connect\char`\"{} requests are coming from, or a UDP socket where it's next packet arrived from.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em port}]ptr to port number of sender. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]host address, test with \char`\"{}is\-Inet\-Address()\char`\"{}. \end{Desc}
\index{ost::Socket@{ost::Socket}!getIPV6Local@{getIPV6Local}}
\index{getIPV6Local@{getIPV6Local}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf IPV6Host} ost::Socket::get\-IPV6Local ({\bf tpport\_\-t} $\ast$ {\em port} = {\tt NULL}) const}\label{classost_1_1_socket_8410324ca8ddf50751830f59afeaf377}


\index{ost::Socket@{ost::Socket}!getIPV6NAT@{getIPV6NAT}}
\index{getIPV6NAT@{getIPV6NAT}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf IPV6Host} ost::Socket::get\-IPV6NAT ({\bf tpport\_\-t} $\ast$ {\em port} = {\tt NULL}) const}\label{classost_1_1_socket_6af9d4d0da053afae46cf26c58c952cc}


\index{ost::Socket@{ost::Socket}!getIPV6Peer@{getIPV6Peer}}
\index{getIPV6Peer@{getIPV6Peer}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf IPV6Host} ost::Socket::get\-IPV6Peer ({\bf tpport\_\-t} $\ast$ {\em port} = {\tt NULL}) const}\label{classost_1_1_socket_d625daf4cffb541c5e8592792d4ee77e}




Reimplemented in {\bf ost::UDPSocket} {\rm (p.\,\pageref{classost_1_1_u_d_p_socket_37b34f874ffb96bfc933b4eda0f6e80c})}.\index{ost::Socket@{ost::Socket}!getIPV6Sender@{getIPV6Sender}}
\index{getIPV6Sender@{getIPV6Sender}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf IPV6Host} ost::Socket::get\-IPV6Sender ({\bf tpport\_\-t} $\ast$ {\em port} = {\tt NULL}) const}\label{classost_1_1_socket_3e4afdfd4efa11d9898558fe852c4230}


\index{ost::Socket@{ost::Socket}!getLocal@{getLocal}}
\index{getLocal@{getLocal}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf IPV4Host} ost::Socket::get\-Local ({\bf tpport\_\-t} $\ast$ {\em port} = {\tt NULL}) const\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_socket_ca71d871bfda4dfcab0891cb0c8df1d4}




Reimplemented in {\bf ost::TCPSocket} {\rm (p.\,\pageref{classost_1_1_t_c_p_socket_a0779bf0973ae5b54a5f323ef62ab4ae})}, and {\bf ost::TCPV6Socket} {\rm (p.\,\pageref{classost_1_1_t_c_p_v6_socket_c886cc40d05790837f9a52bde00c6170})}.\index{ost::Socket@{ost::Socket}!getNAT@{getNAT}}
\index{getNAT@{getNAT}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf IPV4Host} ost::Socket::get\-NAT ({\bf tpport\_\-t} $\ast$ {\em port}) const\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_socket_c3dded47080c852dcebc9998643e8dc6}


\index{ost::Socket@{ost::Socket}!getPeer@{getPeer}}
\index{getPeer@{getPeer}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf IPV4Host} ost::Socket::get\-Peer ({\bf tpport\_\-t} $\ast$ {\em port} = {\tt NULL}) const\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_socket_6fd1dffdfe9606e56fba838559ff6d67}




Reimplemented in {\bf ost::UDPSocket} {\rm (p.\,\pageref{classost_1_1_u_d_p_socket_5d06e7131790dd26cc3cf0b1531af3a2})}.\begin{Desc}
\item[Examples: ]\par
{\bf tcp.cpp}, {\bf tcpservice.cpp}, and {\bf tcpthread.cpp}.\end{Desc}
\index{ost::Socket@{ost::Socket}!getSender@{getSender}}
\index{getSender@{getSender}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf IPV4Host} ost::Socket::get\-Sender ({\bf tpport\_\-t} $\ast$ {\em port} = {\tt NULL}) const\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_socket_99197c017c07c6b24d622b107fa46833}


\index{ost::Socket@{ost::Socket}!getSystemError@{getSystemError}}
\index{getSystemError@{getSystemError}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}long ost::Socket::get\-System\-Error (void) const\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_socket_7720aace2bf055d21a6fc33007c88197}


\index{ost::Socket@{ost::Socket}!getSystemErrorString@{getSystemErrorString}}
\index{getSystemErrorString@{getSystemErrorString}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ ost::Socket::get\-System\-Error\-String (void) const}\label{classost_1_1_socket_69b34d0fdbb94b77df4647cdb8b98407}


\index{ost::Socket@{ost::Socket}!isActive@{isActive}}
\index{isActive@{isActive}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool ost::Socket::is\-Active (void) const}\label{classost_1_1_socket_114e5d4cad99aaff24718b05bd3e8e31}


Test to see if the socket is at least operating or if it is mearly initialized. 

\char`\"{}initialized\char`\"{} sockets may be the result of failed constructors.

\begin{Desc}
\item[Returns:]true if not in initial state. \end{Desc}
\index{ost::Socket@{ost::Socket}!isBroadcast@{isBroadcast}}
\index{isBroadcast@{isBroadcast}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool ost::Socket::is\-Broadcast (void) const\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_socket_8120ca95daa7c488255c308998427ccb}


Return if broadcast has been enabled for the specified socket. 

\begin{Desc}
\item[Returns:]true if broadcast socket. \end{Desc}
\index{ost::Socket@{ost::Socket}!isConnected@{isConnected}}
\index{isConnected@{isConnected}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool ost::Socket::is\-Connected (void) const}\label{classost_1_1_socket_2997c1ed398ce1c6dbf1eb62301f97cc}


Can test to see if this socket is \char`\"{}connected\char`\"{}, and hence whether a \char`\"{}catch\char`\"{} can safely call {\bf get\-Peer()}{\rm (p.\,\pageref{classost_1_1_socket_6fd1dffdfe9606e56fba838559ff6d67})}. 

Of course, an unconnected socket will return a 0.0.0.0 address from {\bf get\-Peer()}{\rm (p.\,\pageref{classost_1_1_socket_6fd1dffdfe9606e56fba838559ff6d67})} as well.

\begin{Desc}
\item[Returns:]true when socket is connected to a peer. \end{Desc}
\index{ost::Socket@{ost::Socket}!isPending@{isPending}}
\index{isPending@{isPending}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool ost::Socket::is\-Pending ({\bf Pending} {\em pend}, {\bf timeout\_\-t} {\em timeout} = {\tt TIMEOUT\_\-INF})\hspace{0.3cm}{\tt  [virtual]}}\label{classost_1_1_socket_8eb84be4b5cc91731c16be4f32f5bf3d}


Get the status of pending operations. 

This can be used to examine if input or output is waiting, or if an error has occured on the descriptor.

\begin{Desc}
\item[Returns:]true if ready, false on timeout. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pend}]ready check to perform. \item[{\em timeout}]in milliseconds, inf. if not specified. \end{description}
\end{Desc}
\index{ost::Socket@{ost::Socket}!isRouted@{isRouted}}
\index{isRouted@{isRouted}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool ost::Socket::is\-Routed (void) const\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_socket_0a1e09a4411bf60bb5e2b6235d4e6a46}


Return if socket routing is enabled. 

\begin{Desc}
\item[Returns:]true if routing enabled. \end{Desc}
\index{ost::Socket@{ost::Socket}!join@{join}}
\index{join@{join}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::join (const {\bf IPV6Multicast} \& {\em ia})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_b7d4e7cfd0411833ab0b02db1dbed8d5}




Reimplemented in {\bf ost::UDPReceive} {\rm (p.\,\pageref{classost_1_1_u_d_p_receive_3d1491c118a0609aa6f67aed9a7a5103})}.\index{ost::Socket@{ost::Socket}!join@{join}}
\index{join@{join}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::join (const {\bf IPV4Multicast} \& {\em ia})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_fb0e2d234f461ce45711bff52ffc96ad}


Join a multicast group. 

\begin{Desc}
\item[Returns:]0 (err\-Success) on success, else error code. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ia}]address of multicast group to join. \end{description}
\end{Desc}


Reimplemented in {\bf ost::UDPReceive} {\rm (p.\,\pageref{classost_1_1_u_d_p_receive_29df9040b68e4e6b99a03827d7e112c8})}.\index{ost::Socket@{ost::Socket}!operator"!@{operator"!}}
\index{operator"!@{operator"!}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool ost::Socket::operator! () const}\label{classost_1_1_socket_5e2c05b34bded0db1bcdcf08bd44f052}


Operator based testing to see if a socket is currently active. 



Reimplemented in {\bf ost::unixstream} {\rm (p.\,\pageref{classost_1_1unixstream_e2fd7abfaf4da197090ba24f42fa255d})}.\index{ost::Socket@{ost::Socket}!operator=@{operator=}}
\index{operator=@{operator=}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Socket}\& ost::Socket::operator= (const {\bf Socket} \& {\em from})}\label{classost_1_1_socket_b0d02dbca94775d6b28c9d313b55fdcc}


Sockets may also be duplicated by the assignment operator. 

\index{ost::Socket@{ost::Socket}!readData@{readData}}
\index{readData@{readData}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ssize\_\-t ost::Socket::read\-Data (void $\ast$ {\em buf}, size\_\-t {\em len}, char {\em separator} = {\tt 0}, {\bf timeout\_\-t} {\em t} = {\tt 0})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classost_1_1_socket_344ae2c256e388447f198288d2d0b41d}


Read in a block of len bytes with specific separator. 

Can be zero, or any other char. If $\backslash$n or $\backslash$r, it's treated just like a {\bf read\-Line()}{\rm (p.\,\pageref{classost_1_1_socket_74e77522b18ff7f10774c2fd333b99c3})}. Otherwise it looks for the separator.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em buf}]pointer to byte allocation. \item[{\em len}]maximum length to read. \item[{\em separator}]separator for a particular ASCII character \item[{\em t}]timeout for pending data in milliseconds. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]number of bytes actually read. \end{Desc}
\index{ost::Socket@{ost::Socket}!readLine@{readLine}}
\index{readLine@{readLine}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ssize\_\-t ost::Socket::read\-Line (char $\ast$ {\em buf}, size\_\-t {\em len}, {\bf timeout\_\-t} {\em timeout} = {\tt 0})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_74e77522b18ff7f10774c2fd333b99c3}


{\bf Process}{\rm (p.\,\pageref{classost_1_1_process})} a logical input line from a socket descriptor directly. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em buf}]pointer to string. \item[{\em len}]maximum length to read. \item[{\em timeout}]for pending data in milliseconds. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]number of bytes actually read. \end{Desc}
\index{ost::Socket@{ost::Socket}!receiveBuffer@{receiveBuffer}}
\index{receiveBuffer@{receiveBuffer}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::receive\-Buffer (unsigned {\em size})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_e3bd5146ee9b4b5dbc0da8bbbc8457ce}


Set the protocol stack network kernel receive buffer size associated with the socket. 

\begin{Desc}
\item[Returns:]err\-Success on success, or error. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em size}]of buffer in bytes. \end{description}
\end{Desc}
\index{ost::Socket@{ost::Socket}!receiveLimit@{receiveLimit}}
\index{receiveLimit@{receiveLimit}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::receive\-Limit (int {\em limit} = {\tt 1})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_e9b26fb7d8253c5507d9d1b92bd50742}


Set thr receive limit. 

\index{ost::Socket@{ost::Socket}!receiveTimeout@{receiveTimeout}}
\index{receiveTimeout@{receiveTimeout}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::receive\-Timeout ({\bf timeout\_\-t} {\em timer})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_20b144ed2110e3b1c597875aa44be6df}


Receive timeout for receiving raw network data. 

\begin{Desc}
\item[Returns:]err\-Success if set. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em timer}]value in milliseconds. \end{description}
\end{Desc}
\index{ost::Socket@{ost::Socket}!sendBuffer@{sendBuffer}}
\index{sendBuffer@{sendBuffer}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::send\-Buffer (unsigned {\em size})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_20ad4739d705c429a9eb5388e4a3bccf}


Set the protocol stack network kernel send buffer size associated with the socket. 

\begin{Desc}
\item[Returns:]err\-Success on success, or error. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em size}]of buffer in bytes. \end{description}
\end{Desc}
\index{ost::Socket@{ost::Socket}!sendLimit@{sendLimit}}
\index{sendLimit@{sendLimit}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::send\-Limit (int {\em limit} = {\tt 2048})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_101d527767089e3df6d8cbff84829791}


Set the send limit. 

\index{ost::Socket@{ost::Socket}!sendTimeout@{sendTimeout}}
\index{sendTimeout@{sendTimeout}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::send\-Timeout ({\bf timeout\_\-t} {\em timer})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_e7db59127b8297729d668d4eeed8ccab}


Set the send timeout for sending raw network data. 

\begin{Desc}
\item[Returns:]err\-Success if set. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em timer}]value in millisec. \end{description}
\end{Desc}
\index{ost::Socket@{ost::Socket}!setBroadcast@{setBroadcast}}
\index{setBroadcast@{setBroadcast}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::set\-Broadcast (bool {\em enable})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_1a507041ee5741bcdc906707b1735781}


Set the subnet broadcast flag for the socket. 

This enables sending to a subnet and may require special image privileges depending on the operating system.

\begin{Desc}
\item[Returns:]0 (err\-Success) on success, else error code. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em enable}]when set to true. \end{description}
\end{Desc}


Reimplemented in {\bf ost::UDPTransmit} {\rm (p.\,\pageref{classost_1_1_u_d_p_transmit_86e9e41d05629a5e6f3029ace0d55e38})}.\index{ost::Socket@{ost::Socket}!setCompletion@{setCompletion}}
\index{setCompletion@{setCompletion}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void ost::Socket::set\-Completion (bool {\em immediate})}\label{classost_1_1_socket_16eb72794ce956b2af6b935eb59b2e24}


Used to specify blocking mode for the socket. 

A socket can be made non-blocking by setting set\-Completion(false) or set to block on all access with set\-Completion(true). I do not believe this form of non-blocking socket I/O is supported in winsock, though it provides an alternate asynchronous set of socket services.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em immediate}]mode specify socket I/O call blocking mode. \end{description}
\end{Desc}
\begin{Desc}
\item[Examples: ]\par
{\bf tcpservice.cpp}.\end{Desc}
\index{ost::Socket@{ost::Socket}!setError@{setError}}
\index{setError@{setError}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void ost::Socket::set\-Error (bool {\em enable})\hspace{0.3cm}{\tt  [inline, protected]}}\label{classost_1_1_socket_6f54a68eab25ab41bbe13ba87a48b435}


This service is used to turn the error handler on or off for \char`\"{}throwing\char`\"{} exceptions by manipulating the thrown flag. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em enable}]true to enable handler. \end{description}
\end{Desc}
\index{ost::Socket@{ost::Socket}!setKeepAlive@{setKeepAlive}}
\index{setKeepAlive@{setKeepAlive}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::set\-Keep\-Alive (bool {\em enable})}\label{classost_1_1_socket_866263b2933c0b7b649829f07ca288ff}


Set the keep-alive status of this socket and if keep-alive messages will be sent. 

\begin{Desc}
\item[Returns:]0 on success. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em enable}]keep alive messages. \end{description}
\end{Desc}
\index{ost::Socket@{ost::Socket}!setLinger@{setLinger}}
\index{setLinger@{setLinger}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::set\-Linger (bool {\em linger})}\label{classost_1_1_socket_8a7b1c8f4735ffb2c8e7248e4bf37ef3}


Enable lingering sockets on close. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em linger}]specify linger enable. \end{description}
\end{Desc}
\index{ost::Socket@{ost::Socket}!setLoopbackByFamily@{setLoopbackByFamily}}
\index{setLoopbackByFamily@{setLoopbackByFamily}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::set\-Loopback\-By\-Family (bool {\em enable}, {\bf Family} {\em family} = {\tt IPV4})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_08683bc57bede572b8effb07a3fc68dc}


Set the multicast loopback flag for the socket. 

Loopback enables a socket to hear what it is sending.

\begin{Desc}
\item[Returns:]0 (err\-Success) on success, else error code. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em enable}]when set to true. \item[{\em family}]of protocol. \end{description}
\end{Desc}
\index{ost::Socket@{ost::Socket}!setMulticastByFamily@{setMulticastByFamily}}
\index{setMulticastByFamily@{setMulticastByFamily}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::set\-Multicast\-By\-Family (bool {\em enable}, {\bf Family} {\em family} = {\tt IPV4})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_09b396c3fc7316061a3f0539e918a43f}


Setting multicast binds the multicast interface used for the socket to the interface the socket itself has been implicitly bound to. 

It is also used as a check flag to make sure multicast is enabled before multicast operations are used.

\begin{Desc}
\item[Returns:]0 (err\-Success) on success, else error code. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em enable}]when set to true. \item[{\em family}]of protocol. \end{description}
\end{Desc}
\index{ost::Socket@{ost::Socket}!setNoDelay@{setNoDelay}}
\index{setNoDelay@{setNoDelay}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::set\-No\-Delay (bool {\em enable})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_a2c47291cf56762847cf82edfc63e473}


Enable/disable delaying packets (Nagle algorithm). 

\begin{Desc}
\item[Returns:]0 on success. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em enable}]disable Nagle algorithm when set to true. \end{description}
\end{Desc}
\index{ost::Socket@{ost::Socket}!setRouting@{setRouting}}
\index{setRouting@{setRouting}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::set\-Routing (bool {\em enable})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_2165fdf85e39e6a8aaff3da889ae7e20}


Set the socket routing to indicate if outgoing messages should bypass normal routing (set false). 

\begin{Desc}
\item[Returns:]0 on success. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em enable}]normal routing when set to true. \end{description}
\end{Desc}


Reimplemented in {\bf ost::UDPTransmit} {\rm (p.\,\pageref{classost_1_1_u_d_p_transmit_04ebd34e6cfc70146bfe3789c31d8903})}, and {\bf ost::UDPReceive} {\rm (p.\,\pageref{classost_1_1_u_d_p_receive_e28ec2a16ac42d1a14f015ca5daa260f})}.\index{ost::Socket@{ost::Socket}!setTimeToLiveByFamily@{setTimeToLiveByFamily}}
\index{setTimeToLiveByFamily@{setTimeToLiveByFamily}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::set\-Time\-To\-Live\-By\-Family (unsigned char {\em ttl}, {\bf Family} {\em fam} = {\tt IPV4})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_23d69227150ae996caf76b01024c1b20}


Set the multicast time to live for a multicast socket. 

\begin{Desc}
\item[Returns:]0 (err\-Success) on success, else error code. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ttl}]time to live. \item[{\em fam}]family of protocol. \end{description}
\end{Desc}
\index{ost::Socket@{ost::Socket}!setTypeOfService@{setTypeOfService}}
\index{setTypeOfService@{setTypeOfService}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Socket::set\-Type\-Of\-Service ({\bf Tos} {\em service})}\label{classost_1_1_socket_e49df7e3c3913147116d8491f77a1b63}


Set packet scheduling on platforms which support ip quality of service conventions. 

This effects how packets in the queue are scheduled through the interface.

\begin{Desc}
\item[Returns:]0 on success, error code on failure. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em service}]type of service enumerated type. \end{description}
\end{Desc}
\index{ost::Socket@{ost::Socket}!writeData@{writeData}}
\index{writeData@{writeData}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ssize\_\-t ost::Socket::write\-Data (const void $\ast$ {\em buf}, size\_\-t {\em len}, {\bf timeout\_\-t} {\em t} = {\tt 0})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classost_1_1_socket_e81f041407f05517bc1a8b30896965f3}


Write a block of len bytes to socket. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em buf}]pointer to byte allocation. \item[{\em len}]maximum length to write. \item[{\em t}]timeout for pending data in milliseconds. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]number of bytes actually read. \end{Desc}


\subsection{Friends And Related Function Documentation}
\index{ost::Socket@{ost::Socket}!dupSocket@{dupSocket}}
\index{dupSocket@{dupSocket}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf SOCKET} dup\-Socket ({\bf SOCKET} {\em s}, {\bf Socket::State} {\em state})\hspace{0.3cm}{\tt  [friend]}}\label{classost_1_1_socket_15cb7666fe8982dc64e01354ac48dac4}




\subsection{Member Data Documentation}
\index{ost::Socket@{ost::Socket}!broadcast@{broadcast}}
\index{broadcast@{broadcast}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool {\bf ost::Socket::broadcast}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_2b6b25a155d401b661d62eef57754bfa}


\index{ost::Socket@{ost::Socket}!completion@{completion}}
\index{completion@{completion}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool {\bf ost::Socket::completion}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_f1ef1afa83f77869dc56910ff289d0c5}


\index{ost::Socket@{ost::Socket}!flags@{flags}}
\index{flags@{flags}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}struct \{ ... \}   {\bf ost::Socket::flags}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_16622c150177604c25b58072f1985225}


\index{ost::Socket@{ost::Socket}!keepalive@{keepalive}}
\index{keepalive@{keepalive}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool {\bf ost::Socket::keepalive}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_507d2a060e03c63bbdf0599ffa9d555a}


\index{ost::Socket@{ost::Socket}!linger@{linger}}
\index{linger@{linger}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool {\bf ost::Socket::linger}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_617e01f010e15ec81be466052a5a378e}


\index{ost::Socket@{ost::Socket}!loopback@{loopback}}
\index{loopback@{loopback}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool {\bf ost::Socket::loopback}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_19604a7ca524f3ee4c7623c7c237ff69}


\index{ost::Socket@{ost::Socket}!multicast@{multicast}}
\index{multicast@{multicast}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool {\bf ost::Socket::multicast}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_85db9df29af07929253387d76c59ab2b}


\index{ost::Socket@{ost::Socket}!mutex@{mutex}}
\index{mutex@{mutex}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Mutex} {\bf ost::Socket::mutex}\hspace{0.3cm}{\tt  [static, protected]}}\label{classost_1_1_socket_795099d3d68f4c3bf7731f263cbd1ace}


\index{ost::Socket@{ost::Socket}!route@{route}}
\index{route@{route}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool {\bf ost::Socket::route}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_118af6ea8eba44a8dbe687f2d31a9022}


\index{ost::Socket@{ost::Socket}!so@{so}}
\index{so@{so}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf SOCKET} volatile {\bf ost::Socket::so}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_f1291caf47c2e2e72a3214e4da206b07}


the actual socket descriptor, in Windows, unlike posix it $\ast$cannot$\ast$ be used as an file descriptor that way madness lies -- jfc 

\index{ost::Socket@{ost::Socket}!state@{state}}
\index{state@{state}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf State} volatile {\bf ost::Socket::state}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_72526c7c326a7faa20e96e9be01981ba}


\index{ost::Socket@{ost::Socket}!thrown@{thrown}}
\index{thrown@{thrown}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool {\bf ost::Socket::thrown}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_9ade0c61ad6d9b0d27c71497b6e68bd5}


\index{ost::Socket@{ost::Socket}!ttl@{ttl}}
\index{ttl@{ttl}!ost::Socket@{ost::Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned {\bf ost::Socket::ttl}\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_socket_6adc7a5d594ab3b8bace496f7a6757e9}




The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
{\bf socket.h}\end{CompactItemize}