summaryrefslogtreecommitdiff
path: root/doc/latex/classSocket.tex
diff options
context:
space:
mode:
Diffstat (limited to 'doc/latex/classSocket.tex')
-rw-r--r--doc/latex/classSocket.tex180
1 files changed, 180 insertions, 0 deletions
diff --git a/doc/latex/classSocket.tex b/doc/latex/classSocket.tex
new file mode 100644
index 0000000..fb6d58b
--- /dev/null
+++ b/doc/latex/classSocket.tex
@@ -0,0 +1,180 @@
+\section{Socket Class Reference}
+\label{classSocket}\index{Socket@{Socket}}
+{\tt \#include $<$Practical\-Socket.h$>$}
+
+Inheritance diagram for Socket::\begin{figure}[H]
+\begin{center}
+\leavevmode
+\includegraphics[height=4cm]{classSocket}
+\end{center}
+\end{figure}
+\subsection*{Public Member Functions}
+\begin{CompactItemize}
+\item
+{\bf $\sim$Socket} ()
+\item
+string {\bf get\-Local\-Address} () throw (Socket\-Exception)
+\item
+unsigned short {\bf get\-Local\-Port} () throw (Socket\-Exception)
+\item
+void {\bf set\-Local\-Port} (unsigned short local\-Port) throw (Socket\-Exception)
+\item
+void {\bf set\-Local\-Address\-And\-Port} (const string \&local\-Address, unsigned short local\-Port=0) throw (Socket\-Exception)
+\end{CompactItemize}
+\subsection*{Static Public Member Functions}
+\begin{CompactItemize}
+\item
+static void {\bf clean\-Up} () throw (Socket\-Exception)
+\item
+static unsigned short {\bf resolve\-Service} (const string \&service, const string \&protocol=\char`\"{}tcp\char`\"{})
+\end{CompactItemize}
+\subsection*{Protected Member Functions}
+\begin{CompactItemize}
+\item
+{\bf Socket} (int type, int protocol) throw (Socket\-Exception)
+\item
+{\bf Socket} (int {\bf sock\-Desc})
+\end{CompactItemize}
+\subsection*{Protected Attributes}
+\begin{CompactItemize}
+\item
+int {\bf sock\-Desc}
+\end{CompactItemize}
+\subsection*{Private Member Functions}
+\begin{CompactItemize}
+\item
+{\bf Socket} (const {\bf Socket} \&sock)
+\item
+void {\bf operator=} (const {\bf Socket} \&sock)
+\end{CompactItemize}
+
+
+\subsection{Detailed Description}
+Base class representing basic communication endpoint
+
+
+
+\subsection{Constructor \& Destructor Documentation}
+\index{Socket@{Socket}!~Socket@{$\sim$Socket}}
+\index{~Socket@{$\sim$Socket}!Socket@{Socket}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Socket::$\sim$Socket ()}\label{classSocket_eac4eb6379a543d38ed88977d3b6630a}
+
+
+Close and deallocate this socket \index{Socket@{Socket}!Socket@{Socket}}
+\index{Socket@{Socket}!Socket@{Socket}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Socket::Socket (const {\bf Socket} \& {\em sock})\hspace{0.3cm}{\tt [private]}}\label{classSocket_656389d58fa00729ff70c4e159623f5c}
+
+
+\index{Socket@{Socket}!Socket@{Socket}}
+\index{Socket@{Socket}!Socket@{Socket}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Socket::Socket (int {\em type}, int {\em protocol}) throw ({\bf Socket\-Exception})\hspace{0.3cm}{\tt [protected]}}\label{classSocket_53e00027bab2125a2b407914c6148589}
+
+
+\index{Socket@{Socket}!Socket@{Socket}}
+\index{Socket@{Socket}!Socket@{Socket}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Socket::Socket (int {\em sock\-Desc})\hspace{0.3cm}{\tt [protected]}}\label{classSocket_6a2609eef6559336a595a336f138d395}
+
+
+
+
+\subsection{Member Function Documentation}
+\index{Socket@{Socket}!getLocalAddress@{getLocalAddress}}
+\index{getLocalAddress@{getLocalAddress}!Socket@{Socket}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}string Socket::get\-Local\-Address () throw ({\bf Socket\-Exception})}\label{classSocket_0fca07bdfa97874fba1a17995ed7cda3}
+
+
+Get the local address \begin{Desc}
+\item[Returns:]local address of socket \end{Desc}
+\begin{Desc}
+\item[Exceptions:]
+\begin{description}
+\item[{\em \doxyref{Socket\-Exception}{p.}{classSocketException}}]thrown if fetch fails \end{description}
+\end{Desc}
+\index{Socket@{Socket}!getLocalPort@{getLocalPort}}
+\index{getLocalPort@{getLocalPort}!Socket@{Socket}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned short Socket::get\-Local\-Port () throw ({\bf Socket\-Exception})}\label{classSocket_e01143b667d69483a2f53d0f4ce7eeed}
+
+
+Get the local port \begin{Desc}
+\item[Returns:]local port of socket \end{Desc}
+\begin{Desc}
+\item[Exceptions:]
+\begin{description}
+\item[{\em \doxyref{Socket\-Exception}{p.}{classSocketException}}]thrown if fetch fails \end{description}
+\end{Desc}
+\index{Socket@{Socket}!setLocalPort@{setLocalPort}}
+\index{setLocalPort@{setLocalPort}!Socket@{Socket}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Socket::set\-Local\-Port (unsigned short {\em local\-Port}) throw ({\bf Socket\-Exception})}\label{classSocket_773fe4a35146002de76952e16fdebcfa}
+
+
+Set the local port to the specified port and the local address to any interface \begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em local\-Port}]local port \end{description}
+\end{Desc}
+\begin{Desc}
+\item[Exceptions:]
+\begin{description}
+\item[{\em \doxyref{Socket\-Exception}{p.}{classSocketException}}]thrown if setting local port fails \end{description}
+\end{Desc}
+\index{Socket@{Socket}!setLocalAddressAndPort@{setLocalAddressAndPort}}
+\index{setLocalAddressAndPort@{setLocalAddressAndPort}!Socket@{Socket}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Socket::set\-Local\-Address\-And\-Port (const string \& {\em local\-Address}, unsigned short {\em local\-Port} = {\tt 0}) throw ({\bf Socket\-Exception})}\label{classSocket_a6b986410bc2e606ba27d01fa7cb8836}
+
+
+Set the local port to the specified port and the local address to the specified address. If you omit the port, a random port will be selected. \begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em local\-Address}]local address \item[{\em local\-Port}]local port \end{description}
+\end{Desc}
+\begin{Desc}
+\item[Exceptions:]
+\begin{description}
+\item[{\em \doxyref{Socket\-Exception}{p.}{classSocketException}}]thrown if setting local port or address fails \end{description}
+\end{Desc}
+\index{Socket@{Socket}!cleanUp@{cleanUp}}
+\index{cleanUp@{cleanUp}!Socket@{Socket}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Socket::clean\-Up () throw ({\bf Socket\-Exception})\hspace{0.3cm}{\tt [static]}}\label{classSocket_c5060aeb501044044351d5a85b3fc95f}
+
+
+If Win\-Sock, unload the Win\-Sock DLLs; otherwise do nothing. We ignore this in our sample client code but include it in the library for completeness. If you are running on Windows and you are concerned about DLL resource consumption, call this after you are done with all \doxyref{Socket}{p.}{classSocket} instances. If you execute this on Windows while some instance of \doxyref{Socket}{p.}{classSocket} exists, you are toast. For portability of client code, this is an empty function on non-Windows platforms so you can always include it. \begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em buffer}]buffer to receive the data \item[{\em buffer\-Len}]maximum number of bytes to read into buffer \end{description}
+\end{Desc}
+\begin{Desc}
+\item[Returns:]number of bytes read, 0 for EOF, and -1 for error \end{Desc}
+\begin{Desc}
+\item[Exceptions:]
+\begin{description}
+\item[{\em \doxyref{Socket\-Exception}{p.}{classSocketException}}]thrown Win\-Sock clean up fails \end{description}
+\end{Desc}
+\index{Socket@{Socket}!resolveService@{resolveService}}
+\index{resolveService@{resolveService}!Socket@{Socket}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned short Socket::resolve\-Service (const string \& {\em service}, const string \& {\em protocol} = {\tt \char`\"{}tcp\char`\"{}})\hspace{0.3cm}{\tt [static]}}\label{classSocket_982c63b25c5b756321a74074a275adbc}
+
+
+Resolve the specified service for the specified protocol to the corresponding port number in host byte order \begin{Desc}
+\item[Parameters:]
+\begin{description}
+\item[{\em service}]service to resolve (e.g., \char`\"{}http\char`\"{}) \item[{\em protocol}]protocol of service to resolve. Default is \char`\"{}tcp\char`\"{}. \end{description}
+\end{Desc}
+\index{Socket@{Socket}!operator=@{operator=}}
+\index{operator=@{operator=}!Socket@{Socket}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Socket::operator= (const {\bf Socket} \& {\em sock})\hspace{0.3cm}{\tt [private]}}\label{classSocket_1ef8f4c222c32756c8b1537323702df8}
+
+
+
+
+\subsection{Member Data Documentation}
+\index{Socket@{Socket}!sockDesc@{sockDesc}}
+\index{sockDesc@{sockDesc}!Socket@{Socket}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf Socket::sock\-Desc}\hspace{0.3cm}{\tt [protected]}}\label{classSocket_d5704d2fdfb062139e1f88831617bbfb}
+
+
+
+
+The documentation for this class was generated from the following files:\begin{CompactItemize}
+\item
+{\bf Practical\-Socket.h}\item
+{\bf Practical\-Socket.cpp}\end{CompactItemize}