\section{TPProto::Connection Class Reference}
\label{classTPProto_1_1Connection}\index{TPProto::Connection@{TPProto::Connection}}
Abstract class for reading and writing to sockets.  


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

Inheritance diagram for TPProto::Connection::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2cm]{classTPProto_1_1Connection}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
void \textbf{set\-Socket} ({\bf TPSocket} $\ast$sock)\label{classTPProto_1_1Connection_99b30157db14d4063cd3eb3e9cb1adfe}

\item 
void \textbf{set\-Event\-Loop} ({\bf Event\-Loop} $\ast$el)\label{classTPProto_1_1Connection_2702f12c45fa95a8d199069661b5913b}

\item 
virtual void {\bf ready\-To\-Read} ()=0
\begin{CompactList}\small\item\em Called when the socket has data ready to be read. \item\end{CompactList}\item 
virtual void {\bf ready\-To\-Send} ()=0
\begin{CompactList}\small\item\em Called when the socket is ready for data to be sent to it. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf TPSocket} $\ast$ {\bf socket}\label{classTPProto_1_1Connection_5068ef530d7b4556354beec3b5e415db}

\begin{CompactList}\small\item\em The \doxyref{TPSocket}{p.}{classTPProto_1_1TPSocket} this connection is connected to. \item\end{CompactList}\item 
{\bf Event\-Loop} $\ast$ {\bf eventloop}\label{classTPProto_1_1Connection_d6b70007895038b60afabefa8281aa46}

\begin{CompactList}\small\item\em The \doxyref{Event\-Loop}{p.}{classTPProto_1_1EventLoop} to use. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Abstract class for reading and writing to sockets. 

The protocol releated to the this connection and socket is implemented in a subclass of \doxyref{Connection}{p.}{classTPProto_1_1Connection}. 



\subsection{Member Function Documentation}
\index{TPProto::Connection@{TPProto::Connection}!readyToRead@{readyToRead}}
\index{readyToRead@{readyToRead}!TPProto::Connection@{TPProto::Connection}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void TPProto::Connection::ready\-To\-Read ()\hspace{0.3cm}{\tt  [pure virtual]}}\label{classTPProto_1_1Connection_75c4ba0d071816553eae209f43189b96}


Called when the socket has data ready to be read. 

Protocol reading entry point is here. Non-blocking sockets should be used. 

Implemented in {\bf TPProto::Frame\-Codec} \doxyref{}{p.}{classTPProto_1_1FrameCodec_b3685152543f15b2af38871034d3e205}.\index{TPProto::Connection@{TPProto::Connection}!readyToSend@{readyToSend}}
\index{readyToSend@{readyToSend}!TPProto::Connection@{TPProto::Connection}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void TPProto::Connection::ready\-To\-Send ()\hspace{0.3cm}{\tt  [pure virtual]}}\label{classTPProto_1_1Connection_dc5d7cbed3ddd193900305b915535e66}


Called when the socket is ready for data to be sent to it. 

This can be used to send queued data when non-blocking writes say they would have blocked. 

Implemented in {\bf TPProto::Frame\-Codec} \doxyref{}{p.}{classTPProto_1_1FrameCodec_3269e53fee288a156af0c8c4c77379d2}.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
tpproto/{\bf connection.h}\item 
tpproto/connection.cpp\end{CompactItemize}
