\section{CTCPIPComm\-Connect Klassenreferenz}
\label{classCTCPIPCommConnect}\index{CTCPIPCommConnect@{CTCPIPCommConnect}}
Class of CTCPIPComm\-Connect.  


{\tt \#include $<$TCPIPComm\-Connect.h$>$}

Klassendiagramm f\"{u}r CTCPIPComm\-Connect::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=4cm]{classCTCPIPCommConnect}
\end{center}
\end{figure}
\subsection*{\"{O}ffentliche Methoden}
\begin{CompactItemize}
\item 
{\bf CTCPIPComm\-Connect} ()
\begin{CompactList}\small\item\em Conctuctor creates a new object of CTCPIPComm\-Connect. \item\end{CompactList}\item 
virtual {\bf $\sim$CTCPIPComm\-Connect} ()\label{classCTCPIPCommConnect_a1}

\begin{CompactList}\small\item\em destructor \item\end{CompactList}\item 
void {\bf Initialize} (const short TCPport, const char $\ast$p\-IPAddress, const bool Passive\-Connection=false)
\begin{CompactList}\small\item\em Initialize Initializes and stars the connection thread. \item\end{CompactList}\item 
bool {\bf Connect\-Request} (SOCKET Passive\-Socket)
\begin{CompactList}\small\item\em Connect\-Request Tries to establish the connection to the communication partner. \item\end{CompactList}\item 
bool {\bf Disconnect\-Request} (void)
\begin{CompactList}\small\item\em Disconnect\-Request Close the current connection. \item\end{CompactList}\item 
int {\bf Get\-Last\-Socket\-Error} (void) const
\begin{CompactList}\small\item\em Get\-Last\-Socket\-Error Returns the last socket error occured. \item\end{CompactList}\item 
bool {\bf Terminating} (void) const
\begin{CompactList}\small\item\em Terminating Returns the state whether the class is terminating (destructor) or not. \item\end{CompactList}\item 
SOCKET {\bf Get\-Socket} (void)
\begin{CompactList}\small\item\em Get\-Socket Returns the socket of the established connection. \item\end{CompactList}\item 
unsigned long {\bf Get\-Remote\-IPAddr} (void)
\begin{CompactList}\small\item\em Get\-Remote\-IPAddr Returns the remote IP Address as a long value. \item\end{CompactList}\item 
in\_\-addr {\bf Conv\-To\-In\-Addr} (unsigned long n\-IPAddress) const
\begin{CompactList}\small\item\em Conv\-To\-In\-Addr Returns a IP Address as a in\_\-addr. \item\end{CompactList}\item 
const SOCKADDR\_\-IN \& {\bf Get\-Remote\-Addr} (void)
\begin{CompactList}\small\item\em Returns the remote IP Address as a SOCKADDR\_\-IN. \item\end{CompactList}\item 
SOCKADDR\_\-IN {\bf Conv\-TCPAddr\-To\-Socket\-Addr} (const short TCPport, const char $\ast$p\-IPAddr)
\begin{CompactList}\small\item\em Conv\-TCPAddr\-To\-Socket\-Addr Converts the TCP port and IP Address string into a socket address. \item\end{CompactList}\end{CompactItemize}
\subsection*{Gesch\"{u}tzte Methoden}
\begin{CompactItemize}
\item 
virtual void {\bf Con\-Ind} (void)=0
\begin{CompactList}\small\item\em Con\-Ind Indicates that the TCP/IP connection is established. \item\end{CompactList}\item 
virtual void {\bf Dis\-Ind} (void)=0
\begin{CompactList}\small\item\em Dis\-Ind Indicates that the TCP/IP connection was broken down. \item\end{CompactList}\end{CompactItemize}
\subsection*{Private Methoden}
\begin{CompactItemize}
\item 
bool {\bf Await\-Connection} (void)
\begin{CompactList}\small\item\em Await\-Connection Calls the Await Function in order to await a connection. \item\end{CompactList}\item 
bool {\bf Establish\-Connection} (void)
\begin{CompactList}\small\item\em Establish\-Connection Calls the Connect Function in order to establish activley a connection. \item\end{CompactList}\end{CompactItemize}
\subsection*{Private, statische Methoden}
\begin{CompactItemize}
\item 
void {\bf Connect\-Thread} ({\bf CTCPIPComm\-Connect} $\ast$p\-Class)
\begin{CompactList}\small\item\em Conv\-TCPAddr\-To\-Socket\-Addr (static) Start function for the Connect Thread. \item\end{CompactList}\end{CompactItemize}
\subsection*{Private Attribute}
\begin{CompactItemize}
\item 
SOCKET {\bf m\_\-Socket}\label{classCTCPIPCommConnect_r0}

\item 
SOCKET {\bf m\_\-Passive\-Socket}\label{classCTCPIPCommConnect_r1}

\item 
SOCKADDR\_\-IN {\bf m\_\-Remote\-Addr}\label{classCTCPIPCommConnect_r2}

\item 
bool {\bf m\_\-Passive\-Connection}\label{classCTCPIPCommConnect_r3}

\item 
int {\bf m\_\-Last\-Socket\-Error}\label{classCTCPIPCommConnect_r4}

\item 
DWORD {\bf m\_\-Thread\-ID}\label{classCTCPIPCommConnect_r5}

\item 
HANDLE {\bf m\_\-Thread\-Handle}\label{classCTCPIPCommConnect_r6}

\item 
HANDLE {\bf m\_\-h\-Event\-Terminate}\label{classCTCPIPCommConnect_r7}

\item 
HANDLE {\bf m\_\-h\-Event\-Terminate\-Finished}\label{classCTCPIPCommConnect_r8}

\item 
HANDLE {\bf m\_\-h\-Event\-Connecting}\label{classCTCPIPCommConnect_r9}

\item 
unsigned long {\bf m\_\-Remote\-IPAddr}\label{classCTCPIPCommConnect_r10}

\item 
bool {\bf m\_\-Terminating}\label{classCTCPIPCommConnect_r11}

\end{CompactItemize}


\subsection{Ausf\"{u}hrliche Beschreibung}
Class of CTCPIPComm\-Connect. 

\begin{Desc}
\item[Version:]1.1 \end{Desc}
\begin{Desc}
\item[Autor:]Udo Weber \end{Desc}




\subsection{Beschreibung der Konstruktoren und Destruktoren}
\index{CTCPIPCommConnect@{CTCPIPComm\-Connect}!CTCPIPCommConnect@{CTCPIPCommConnect}}
\index{CTCPIPCommConnect@{CTCPIPCommConnect}!CTCPIPCommConnect@{CTCPIPComm\-Connect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}CTCPIPComm\-Connect::CTCPIPComm\-Connect ()}\label{classCTCPIPCommConnect_a0}


Conctuctor creates a new object of CTCPIPComm\-Connect. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em -}]\end{description}
\end{Desc}
\begin{Desc}
\item[R\"{u}ckgabe:]- \end{Desc}


\subsection{Dokumentation der Elementfunktionen}
\index{CTCPIPCommConnect@{CTCPIPComm\-Connect}!AwaitConnection@{AwaitConnection}}
\index{AwaitConnection@{AwaitConnection}!CTCPIPCommConnect@{CTCPIPComm\-Connect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool CTCPIPComm\-Connect::Await\-Connection (void)\hspace{0.3cm}{\tt  [private]}}\label{classCTCPIPCommConnect_d0}


Await\-Connection Calls the Await Function in order to await a connection. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em -}]\end{description}
\end{Desc}
\begin{Desc}
\item[R\"{u}ckgabe:]true if function successful (does not mean that connection is established) \end{Desc}
\index{CTCPIPCommConnect@{CTCPIPComm\-Connect}!ConInd@{ConInd}}
\index{ConInd@{ConInd}!CTCPIPCommConnect@{CTCPIPComm\-Connect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void CTCPIPComm\-Connect::Con\-Ind (void)\hspace{0.3cm}{\tt  [protected, pure virtual]}}\label{classCTCPIPCommConnect_b0}


Con\-Ind Indicates that the TCP/IP connection is established. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em -}]\end{description}
\end{Desc}
\begin{Desc}
\item[R\"{u}ckgabe:]- \end{Desc}


Implementiert in {\bf CTCPIPComm} {\rm (S.\,\pageref{classCTCPIPComm_d0})}.\index{CTCPIPCommConnect@{CTCPIPComm\-Connect}!ConnectRequest@{ConnectRequest}}
\index{ConnectRequest@{ConnectRequest}!CTCPIPCommConnect@{CTCPIPComm\-Connect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool CTCPIPComm\-Connect::Connect\-Request (SOCKET {\em Passive\-Socket})}\label{classCTCPIPCommConnect_a3}


Connect\-Request Tries to establish the connection to the communication partner. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em Passive\-Socket}]Socket for the passive connection estalishment \end{description}
\end{Desc}
\begin{Desc}
\item[R\"{u}ckgabe:]true if function call was successful \end{Desc}
\index{CTCPIPCommConnect@{CTCPIPComm\-Connect}!ConnectThread@{ConnectThread}}
\index{ConnectThread@{ConnectThread}!CTCPIPCommConnect@{CTCPIPComm\-Connect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void CTCPIPComm\-Connect::Connect\-Thread ({\bf CTCPIPComm\-Connect} $\ast$ {\em p\-Class})\hspace{0.3cm}{\tt  [static, private]}}\label{classCTCPIPCommConnect_h0}


Conv\-TCPAddr\-To\-Socket\-Addr (static) Start function for the Connect Thread. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em p\-Class}]Pointer to the current class \end{description}
\end{Desc}
\begin{Desc}
\item[R\"{u}ckgabe:]- \end{Desc}
\index{CTCPIPCommConnect@{CTCPIPComm\-Connect}!ConvTCPAddrToSocketAddr@{ConvTCPAddrToSocketAddr}}
\index{ConvTCPAddrToSocketAddr@{ConvTCPAddrToSocketAddr}!CTCPIPCommConnect@{CTCPIPComm\-Connect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}SOCKADDR\_\-IN CTCPIPComm\-Connect::Conv\-TCPAddr\-To\-Socket\-Addr (const short {\em TCPport}, const char $\ast$ {\em p\-IPAddr})}\label{classCTCPIPCommConnect_a11}


Conv\-TCPAddr\-To\-Socket\-Addr Converts the TCP port and IP Address string into a socket address. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em TCPport}]TCP port \item[{\em p\-IPAddr}]Null terminated string containing IP Address or Name \end{description}
\end{Desc}
\begin{Desc}
\item[R\"{u}ckgabe:]SOCKADDR\_\-IN structure \end{Desc}
\index{CTCPIPCommConnect@{CTCPIPComm\-Connect}!ConvToInAddr@{ConvToInAddr}}
\index{ConvToInAddr@{ConvToInAddr}!CTCPIPCommConnect@{CTCPIPComm\-Connect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}struct in\_\-addr CTCPIPComm\-Connect::Conv\-To\-In\-Addr (unsigned long {\em n\-IPAddress}) const}\label{classCTCPIPCommConnect_a9}


Conv\-To\-In\-Addr Returns a IP Address as a in\_\-addr. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em IP}]Address (ulong format) \end{description}
\end{Desc}
\begin{Desc}
\item[R\"{u}ckgabe:]IP Address (in\_\-addr) \end{Desc}
\index{CTCPIPCommConnect@{CTCPIPComm\-Connect}!DisconnectRequest@{DisconnectRequest}}
\index{DisconnectRequest@{DisconnectRequest}!CTCPIPCommConnect@{CTCPIPComm\-Connect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool CTCPIPComm\-Connect::Disconnect\-Request (void)}\label{classCTCPIPCommConnect_a4}


Disconnect\-Request Close the current connection. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em -}]\end{description}
\end{Desc}
\begin{Desc}
\item[R\"{u}ckgabe:]true if function call was successful \end{Desc}
\index{CTCPIPCommConnect@{CTCPIPComm\-Connect}!DisInd@{DisInd}}
\index{DisInd@{DisInd}!CTCPIPCommConnect@{CTCPIPComm\-Connect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void CTCPIPComm\-Connect::Dis\-Ind (void)\hspace{0.3cm}{\tt  [protected, pure virtual]}}\label{classCTCPIPCommConnect_b1}


Dis\-Ind Indicates that the TCP/IP connection was broken down. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em -}]\end{description}
\end{Desc}
\begin{Desc}
\item[R\"{u}ckgabe:]- \end{Desc}


Implementiert in {\bf CTCPIPComm} {\rm (S.\,\pageref{classCTCPIPComm_d1})}.\index{CTCPIPCommConnect@{CTCPIPComm\-Connect}!EstablishConnection@{EstablishConnection}}
\index{EstablishConnection@{EstablishConnection}!CTCPIPCommConnect@{CTCPIPComm\-Connect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool CTCPIPComm\-Connect::Establish\-Connection (void)\hspace{0.3cm}{\tt  [private]}}\label{classCTCPIPCommConnect_d1}


Establish\-Connection Calls the Connect Function in order to establish activley a connection. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em -}]\end{description}
\end{Desc}
\begin{Desc}
\item[R\"{u}ckgabe:]true if function successful (does not mean that connection is established) \end{Desc}
\index{CTCPIPCommConnect@{CTCPIPComm\-Connect}!GetLastSocketError@{GetLastSocketError}}
\index{GetLastSocketError@{GetLastSocketError}!CTCPIPCommConnect@{CTCPIPComm\-Connect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int CTCPIPComm\-Connect::Get\-Last\-Socket\-Error (void) const\hspace{0.3cm}{\tt  [inline]}}\label{classCTCPIPCommConnect_a5}


Get\-Last\-Socket\-Error Returns the last socket error occured. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em -}]\end{description}
\end{Desc}
\begin{Desc}
\item[R\"{u}ckgabe:]Last socket error \end{Desc}


Erneute Implementation in {\bf CTCPIPComm} {\rm (S.\,\pageref{classCTCPIPComm_a2})}.\index{CTCPIPCommConnect@{CTCPIPComm\-Connect}!GetRemoteAddr@{GetRemoteAddr}}
\index{GetRemoteAddr@{GetRemoteAddr}!CTCPIPCommConnect@{CTCPIPComm\-Connect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const SOCKADDR\_\-IN \& CTCPIPComm\-Connect::Get\-Remote\-Addr (void)\hspace{0.3cm}{\tt  [inline]}}\label{classCTCPIPCommConnect_a10}


Returns the remote IP Address as a SOCKADDR\_\-IN. 

\begin{Desc}
\item[R\"{u}ckgabe:]Remote IP Address \end{Desc}
\index{CTCPIPCommConnect@{CTCPIPComm\-Connect}!GetRemoteIPAddr@{GetRemoteIPAddr}}
\index{GetRemoteIPAddr@{GetRemoteIPAddr}!CTCPIPCommConnect@{CTCPIPComm\-Connect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned long CTCPIPComm\-Connect::Get\-Remote\-IPAddr (void)\hspace{0.3cm}{\tt  [inline]}}\label{classCTCPIPCommConnect_a8}


Get\-Remote\-IPAddr Returns the remote IP Address as a long value. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em -}]\end{description}
\end{Desc}
\begin{Desc}
\item[R\"{u}ckgabe:]Remote IP Address \end{Desc}
\index{CTCPIPCommConnect@{CTCPIPComm\-Connect}!GetSocket@{GetSocket}}
\index{GetSocket@{GetSocket}!CTCPIPCommConnect@{CTCPIPComm\-Connect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}SOCKET CTCPIPComm\-Connect::Get\-Socket (void)\hspace{0.3cm}{\tt  [inline]}}\label{classCTCPIPCommConnect_a7}


Get\-Socket Returns the socket of the established connection. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em -}]\end{description}
\end{Desc}
\begin{Desc}
\item[R\"{u}ckgabe:]Socket \end{Desc}
\index{CTCPIPCommConnect@{CTCPIPComm\-Connect}!Initialize@{Initialize}}
\index{Initialize@{Initialize}!CTCPIPCommConnect@{CTCPIPComm\-Connect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void CTCPIPComm\-Connect::Initialize (const short {\em TCPport}, const char $\ast$ {\em p\-IPAddress}, const bool {\em Passive\-Connection} = {\tt false})}\label{classCTCPIPCommConnect_a2}


Initialize Initializes and stars the connection thread. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em TCPport}]TCP Port to establish the connection \item[{\em p\-IPAddress}]Null terminated String containing IP-Address or Name \item[{\em Passive\-Connection}]False if awaiting connection from partner (default) \end{description}
\end{Desc}
\begin{Desc}
\item[R\"{u}ckgabe:]- \end{Desc}
\index{CTCPIPCommConnect@{CTCPIPComm\-Connect}!Terminating@{Terminating}}
\index{Terminating@{Terminating}!CTCPIPCommConnect@{CTCPIPComm\-Connect}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool CTCPIPComm\-Connect::Terminating (void) const\hspace{0.3cm}{\tt  [inline]}}\label{classCTCPIPCommConnect_a6}


Terminating Returns the state whether the class is terminating (destructor) or not. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em -}]\end{description}
\end{Desc}
\begin{Desc}
\item[R\"{u}ckgabe:]True if terminating \end{Desc}


Die Dokumentation f\"{u}r diese Klasse wurde erzeugt aufgrund der Dateien:\begin{CompactItemize}
\item 
TCPIPComm\-Connect.h\item 
TCPIPComm\-Connect.cpp\end{CompactItemize}
