summaryrefslogtreecommitdiff
path: root/doc/latex/classCommunicatingSocket.tex
blob: addc1f47db34096129f862cfecd3f46eb7dd77f8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
\section{Communicating\-Socket Class Reference}
\label{classCommunicatingSocket}\index{CommunicatingSocket@{CommunicatingSocket}}
{\tt \#include $<$Practical\-Socket.h$>$}

Inheritance diagram for Communicating\-Socket::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=4cm]{classCommunicatingSocket}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
void {\bf connect} (const string \&foreign\-Address, unsigned short foreign\-Port)  throw (Socket\-Exception)
\item 
void {\bf send} (const void $\ast$buffer, int buffer\-Len)  throw (Socket\-Exception)
\item 
int {\bf recv} (void $\ast$buffer, int buffer\-Len)  throw (Socket\-Exception)
\item 
string {\bf get\-Foreign\-Address} ()  throw (Socket\-Exception)
\item 
unsigned short {\bf get\-Foreign\-Port} ()  throw (Socket\-Exception)
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
{\bf Communicating\-Socket} (int type, int protocol)  throw (Socket\-Exception)
\item 
{\bf Communicating\-Socket} (int new\-Conn\-SD)
\end{CompactItemize}


\subsection{Detailed Description}
\doxyref{Socket}{p.}{classSocket} which is able to connect, send, and receive 



\subsection{Constructor \& Destructor Documentation}
\index{CommunicatingSocket@{Communicating\-Socket}!CommunicatingSocket@{CommunicatingSocket}}
\index{CommunicatingSocket@{CommunicatingSocket}!CommunicatingSocket@{Communicating\-Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Communicating\-Socket::Communicating\-Socket (int {\em type}, int {\em protocol})  throw ({\bf Socket\-Exception})\hspace{0.3cm}{\tt  [protected]}}\label{classCommunicatingSocket_0017517b8d6e761fde0c40475af3b2ab}


\index{CommunicatingSocket@{Communicating\-Socket}!CommunicatingSocket@{CommunicatingSocket}}
\index{CommunicatingSocket@{CommunicatingSocket}!CommunicatingSocket@{Communicating\-Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Communicating\-Socket::Communicating\-Socket (int {\em new\-Conn\-SD})\hspace{0.3cm}{\tt  [protected]}}\label{classCommunicatingSocket_27d758db782b3be7d28741e92cb613d1}




\subsection{Member Function Documentation}
\index{CommunicatingSocket@{Communicating\-Socket}!connect@{connect}}
\index{connect@{connect}!CommunicatingSocket@{Communicating\-Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Communicating\-Socket::connect (const string \& {\em foreign\-Address}, unsigned short {\em foreign\-Port})  throw ({\bf Socket\-Exception})}\label{classCommunicatingSocket_9192374d9baab8e189860aa8d913683c}


Establish a socket connection with the given foreign address and port \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em foreign\-Address}]foreign address (IP address or name) \item[{\em foreign\-Port}]foreign port \end{description}
\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em \doxyref{Socket\-Exception}{p.}{classSocketException}}]thrown if unable to establish connection \end{description}
\end{Desc}
\index{CommunicatingSocket@{Communicating\-Socket}!send@{send}}
\index{send@{send}!CommunicatingSocket@{Communicating\-Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Communicating\-Socket::send (const void $\ast$ {\em buffer}, int {\em buffer\-Len})  throw ({\bf Socket\-Exception})}\label{classCommunicatingSocket_ca4e86085c064641e86ae24ea29bbb94}


Write the given buffer to this socket. Call \doxyref{connect()}{p.}{classCommunicatingSocket_9192374d9baab8e189860aa8d913683c} before calling \doxyref{send()}{p.}{classCommunicatingSocket_ca4e86085c064641e86ae24ea29bbb94} \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em buffer}]buffer to be written \item[{\em buffer\-Len}]number of bytes from buffer to be written \end{description}
\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em \doxyref{Socket\-Exception}{p.}{classSocketException}}]thrown if unable to send data \end{description}
\end{Desc}
\index{CommunicatingSocket@{Communicating\-Socket}!recv@{recv}}
\index{recv@{recv}!CommunicatingSocket@{Communicating\-Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Communicating\-Socket::recv (void $\ast$ {\em buffer}, int {\em buffer\-Len})  throw ({\bf Socket\-Exception})}\label{classCommunicatingSocket_7cf1fd470c0060171b68df9f68c7bd01}


Read into the given buffer up to buffer\-Len bytes data from this socket. Call \doxyref{connect()}{p.}{classCommunicatingSocket_9192374d9baab8e189860aa8d913683c} before calling \doxyref{recv()}{p.}{classCommunicatingSocket_7cf1fd470c0060171b68df9f68c7bd01} \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 if unable to receive data \end{description}
\end{Desc}
\index{CommunicatingSocket@{Communicating\-Socket}!getForeignAddress@{getForeignAddress}}
\index{getForeignAddress@{getForeignAddress}!CommunicatingSocket@{Communicating\-Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}string Communicating\-Socket::get\-Foreign\-Address ()  throw ({\bf Socket\-Exception})}\label{classCommunicatingSocket_13f9eca30ef56836cf23c163c848c09e}


Get the foreign address. Call \doxyref{connect()}{p.}{classCommunicatingSocket_9192374d9baab8e189860aa8d913683c} before calling \doxyref{recv()}{p.}{classCommunicatingSocket_7cf1fd470c0060171b68df9f68c7bd01} \begin{Desc}
\item[Returns:]foreign address \end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em \doxyref{Socket\-Exception}{p.}{classSocketException}}]thrown if unable to fetch foreign address \end{description}
\end{Desc}
\index{CommunicatingSocket@{Communicating\-Socket}!getForeignPort@{getForeignPort}}
\index{getForeignPort@{getForeignPort}!CommunicatingSocket@{Communicating\-Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned short Communicating\-Socket::get\-Foreign\-Port ()  throw ({\bf Socket\-Exception})}\label{classCommunicatingSocket_184fbb4775184b87ebd886a5587eb1a3}


Get the foreign port. Call \doxyref{connect()}{p.}{classCommunicatingSocket_9192374d9baab8e189860aa8d913683c} before calling \doxyref{recv()}{p.}{classCommunicatingSocket_7cf1fd470c0060171b68df9f68c7bd01} \begin{Desc}
\item[Returns:]foreign port \end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em \doxyref{Socket\-Exception}{p.}{classSocketException}}]thrown if unable to fetch foreign port \end{description}
\end{Desc}


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}