\hypertarget{classcore_1_1_t_c_p_session}{}\doxysection{core\+::T\+C\+P\+Session Class Reference}
\label{classcore_1_1_t_c_p_session}\index{core::TCPSession@{core::TCPSession}}


{\ttfamily \#include $<$T\+C\+P\+Session.\+h$>$}



Inheritance diagram for core\+::T\+C\+P\+Session\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=320pt]{classcore_1_1_t_c_p_session__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for core\+::T\+C\+P\+Session\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classcore_1_1_t_c_p_session__coll__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classcore_1_1_t_c_p_session_a7e1192babcdeb688f463d3e9e85d0979}{T\+C\+P\+Session}} (\mbox{\hyperlink{classcore_1_1_e_poll}{E\+Poll}} \&\mbox{\hyperlink{classcore_1_1_socket_a3b0b139ac7da581f0d969f6ae9a0c97c}{e\+Poll}}, \mbox{\hyperlink{classcore_1_1_t_c_p_server}{T\+C\+P\+Server}} \&\mbox{\hyperlink{classcore_1_1_t_c_p_session_a265d9493fa544e601b5ad5fb1663340c}{server}}, std\+::string text=\char`\"{}\char`\"{})
\item 
\mbox{\hyperlink{classcore_1_1_t_c_p_session_a3b56450ba155f6a6484e3f07154fe1e7}{$\sim$\+T\+C\+P\+Session}} ()
\item 
virtual void \mbox{\hyperlink{classcore_1_1_t_c_p_session_a50037cbfc515650e04054e5481785981}{output}} (std\+::stringstream \&data)
\item 
void \mbox{\hyperlink{classcore_1_1_t_c_p_session_a2b09eeafef5e44009a77d9da43e3b889}{send}} ()
\item 
void \mbox{\hyperlink{classcore_1_1_t_c_p_session_afdfe135694c6689f5365fac6c090ec33}{send\+To\+All}} ()
\item 
void \mbox{\hyperlink{classcore_1_1_t_c_p_session_a05c489dcd2ebd74f527864759929e351}{send\+To\+All}} (\mbox{\hyperlink{classcore_1_1_session_filter}{Session\+Filter}} filter)
\item 
void \mbox{\hyperlink{classcore_1_1_t_c_p_session_a34936745e8d7669d5400e78d353a56d3}{terminate}} ()
\end{DoxyCompactItemize}
\doxysubsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classcore_1_1_command}{Command}} $\ast$ \mbox{\hyperlink{classcore_1_1_t_c_p_session_a2c39191d695d79891989ea628f42c0a8}{grab}} = N\+U\+LL
\item 
std\+::stringstream \mbox{\hyperlink{classcore_1_1_t_c_p_session_abb302bbb3d7e7bc75490c736364f0d4d}{out}}
\item 
\mbox{\hyperlink{classcore_1_1_t_c_p_server}{T\+C\+P\+Server}} \& \mbox{\hyperlink{classcore_1_1_t_c_p_session_a265d9493fa544e601b5ad5fb1663340c}{server}}
\end{DoxyCompactItemize}
\doxysubsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual void \mbox{\hyperlink{classcore_1_1_t_c_p_session_aed4ed499b978bcea57a8efefe929fc98}{on\+Registered}} () override
\begin{DoxyCompactList}\small\item\em Called after the socket has been registered with epoll processing. \end{DoxyCompactList}\item 
virtual void \mbox{\hyperlink{classcore_1_1_t_c_p_session_ac2c3ffef9ded12a8867e3d27902b001a}{on\+Data\+Received}} (char $\ast$data, int len) override
\item 
virtual void \mbox{\hyperlink{classcore_1_1_t_c_p_session_a0f209620e9f11e70bfde54852b5c5460}{on\+Line\+Received}} (std\+::string line)
\item 
virtual void \mbox{\hyperlink{classcore_1_1_t_c_p_session_a96a4d5e851598ad796c97a2572865c7a}{on\+Block\+Received}} (std\+::string block)
\item 
virtual void \mbox{\hyperlink{classcore_1_1_t_c_p_session_a8719952f7bb00bf7239ec40aa2868626}{on\+Connected}} ()
\item 
virtual void \mbox{\hyperlink{classcore_1_1_t_c_p_session_ae90dc64e2d3c4b3239117923145edb3f}{protocol}} (std\+::string data)
\item 
void \mbox{\hyperlink{classcore_1_1_t_c_p_session_ad76c57be6769fc68b551b5212141e801}{set\+Mode}} (Mode mode, int size=0)
\end{DoxyCompactItemize}
\doxysubsection*{Additional Inherited Members}


\doxysubsection{Detailed Description}
\mbox{\hyperlink{classcore_1_1_t_c_p_session}{T\+C\+P\+Session}}

\mbox{\hyperlink{classcore_1_1_t_c_p_session}{T\+C\+P\+Session}} defines the nature of the interaction with the client and stores persistent data for a defined session. \mbox{\hyperlink{classcore_1_1_t_c_p_session}{T\+C\+P\+Session}} objects are not sockets but instead provide a communications control mechanism. Protocol conversations are provided through extensions from this object. ~\newline
 

\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{classcore_1_1_t_c_p_session_a7e1192babcdeb688f463d3e9e85d0979}\label{classcore_1_1_t_c_p_session_a7e1192babcdeb688f463d3e9e85d0979}} 
\index{core::TCPSession@{core::TCPSession}!TCPSession@{TCPSession}}
\index{TCPSession@{TCPSession}!core::TCPSession@{core::TCPSession}}
\doxysubsubsection{\texorpdfstring{TCPSession()}{TCPSession()}}
{\footnotesize\ttfamily core\+::\+T\+C\+P\+Session\+::\+T\+C\+P\+Session (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classcore_1_1_e_poll}{E\+Poll}} \&}]{e\+Poll,  }\item[{\mbox{\hyperlink{classcore_1_1_t_c_p_server}{T\+C\+P\+Server}} \&}]{server,  }\item[{std\+::string}]{text = {\ttfamily \char`\"{}\char`\"{}} }\end{DoxyParamCaption})}

\mbox{\Hypertarget{classcore_1_1_t_c_p_session_a3b56450ba155f6a6484e3f07154fe1e7}\label{classcore_1_1_t_c_p_session_a3b56450ba155f6a6484e3f07154fe1e7}} 
\index{core::TCPSession@{core::TCPSession}!````~TCPSession@{$\sim$TCPSession}}
\index{````~TCPSession@{$\sim$TCPSession}!core::TCPSession@{core::TCPSession}}
\doxysubsubsection{\texorpdfstring{$\sim$TCPSession()}{~TCPSession()}}
{\footnotesize\ttfamily core\+::\+T\+C\+P\+Session\+::$\sim$\+T\+C\+P\+Session (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classcore_1_1_t_c_p_session_a96a4d5e851598ad796c97a2572865c7a}\label{classcore_1_1_t_c_p_session_a96a4d5e851598ad796c97a2572865c7a}} 
\index{core::TCPSession@{core::TCPSession}!onBlockReceived@{onBlockReceived}}
\index{onBlockReceived@{onBlockReceived}!core::TCPSession@{core::TCPSession}}
\doxysubsubsection{\texorpdfstring{onBlockReceived()}{onBlockReceived()}}
{\footnotesize\ttfamily virtual void core\+::\+T\+C\+P\+Session\+::on\+Block\+Received (\begin{DoxyParamCaption}\item[{std\+::string}]{block }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [protected]}, {\ttfamily [virtual]}}

Override the on\+Block\+Received method to receive a string of characters that represents a single block of data of length determined by the block length value. If on\+Data\+Received was overriden this method will not be called unless the on\+Data\+Received calls this method explicitly using the class and member name. \mbox{\Hypertarget{classcore_1_1_t_c_p_session_a8719952f7bb00bf7239ec40aa2868626}\label{classcore_1_1_t_c_p_session_a8719952f7bb00bf7239ec40aa2868626}} 
\index{core::TCPSession@{core::TCPSession}!onConnected@{onConnected}}
\index{onConnected@{onConnected}!core::TCPSession@{core::TCPSession}}
\doxysubsubsection{\texorpdfstring{onConnected()}{onConnected()}}
{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Session\+::on\+Connected (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [protected]}, {\ttfamily [virtual]}}

This method is called from within the protocol method when protocol is called on the initial connection where the data is an empty string. Use this method to deliver a message to the connection upon connection. \mbox{\Hypertarget{classcore_1_1_t_c_p_session_ac2c3ffef9ded12a8867e3d27902b001a}\label{classcore_1_1_t_c_p_session_ac2c3ffef9ded12a8867e3d27902b001a}} 
\index{core::TCPSession@{core::TCPSession}!onDataReceived@{onDataReceived}}
\index{onDataReceived@{onDataReceived}!core::TCPSession@{core::TCPSession}}
\doxysubsubsection{\texorpdfstring{onDataReceived()}{onDataReceived()}}
{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Session\+::on\+Data\+Received (\begin{DoxyParamCaption}\item[{char $\ast$}]{data,  }\item[{int}]{len }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [protected]}, {\ttfamily [virtual]}}

Override this method to receive data directly from the socket as data is received. If you need data split by line termination characters then override the on\+Line\+Received method instead. 

Reimplemented from \mbox{\hyperlink{classcore_1_1_socket_af6c06db2441633ae9979affe72930abc}{core\+::\+Socket}}.

\mbox{\Hypertarget{classcore_1_1_t_c_p_session_a0f209620e9f11e70bfde54852b5c5460}\label{classcore_1_1_t_c_p_session_a0f209620e9f11e70bfde54852b5c5460}} 
\index{core::TCPSession@{core::TCPSession}!onLineReceived@{onLineReceived}}
\index{onLineReceived@{onLineReceived}!core::TCPSession@{core::TCPSession}}
\doxysubsubsection{\texorpdfstring{onLineReceived()}{onLineReceived()}}
{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Session\+::on\+Line\+Received (\begin{DoxyParamCaption}\item[{std\+::string}]{line }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [protected]}, {\ttfamily [virtual]}}

Override the on\+Line\+Received method to receive a string of characters that represents a single line of data terminated by a LF or C\+R\+LF. If on\+Data\+Received was overriden this method will not be called unless the on\+Data\+Received calls this method explicitly using the class and member name. \mbox{\Hypertarget{classcore_1_1_t_c_p_session_aed4ed499b978bcea57a8efefe929fc98}\label{classcore_1_1_t_c_p_session_aed4ed499b978bcea57a8efefe929fc98}} 
\index{core::TCPSession@{core::TCPSession}!onRegistered@{onRegistered}}
\index{onRegistered@{onRegistered}!core::TCPSession@{core::TCPSession}}
\doxysubsubsection{\texorpdfstring{onRegistered()}{onRegistered()}}
{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Session\+::on\+Registered (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [protected]}, {\ttfamily [virtual]}}



Called after the socket has been registered with epoll processing. 



Reimplemented from \mbox{\hyperlink{classcore_1_1_socket_a23b9824653bbe4652a716acb828665b1}{core\+::\+Socket}}.



Reimplemented in \mbox{\hyperlink{classcore_1_1_t_l_s_session_a8e26fdc9e8a6c573b5a504a1f1b137a9}{core\+::\+T\+L\+S\+Session}}.

\mbox{\Hypertarget{classcore_1_1_t_c_p_session_a50037cbfc515650e04054e5481785981}\label{classcore_1_1_t_c_p_session_a50037cbfc515650e04054e5481785981}} 
\index{core::TCPSession@{core::TCPSession}!output@{output}}
\index{output@{output}!core::TCPSession@{core::TCPSession}}
\doxysubsubsection{\texorpdfstring{output()}{output()}}
{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Session\+::output (\begin{DoxyParamCaption}\item[{std\+::stringstream \&}]{out }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}

The output method is called by a socket session (B\+M\+A\+Session) and will output the detail information for the client socket. When extending B\+M\+A\+T\+C\+P\+Socket or B\+M\+A\+Session you can override the method to add attributes to the list. 

Reimplemented from \mbox{\hyperlink{classcore_1_1_t_c_p_socket_afacf7528ff3c9ac077d7b5a49e2116fd}{core\+::\+T\+C\+P\+Socket}}.



Reimplemented in \mbox{\hyperlink{classcore_1_1_t_l_s_session_ae55de8a035d1ddc560cf619b2030af43}{core\+::\+T\+L\+S\+Session}}.

\mbox{\Hypertarget{classcore_1_1_t_c_p_session_ae90dc64e2d3c4b3239117923145edb3f}\label{classcore_1_1_t_c_p_session_ae90dc64e2d3c4b3239117923145edb3f}} 
\index{core::TCPSession@{core::TCPSession}!protocol@{protocol}}
\index{protocol@{protocol}!core::TCPSession@{core::TCPSession}}
\doxysubsubsection{\texorpdfstring{protocol()}{protocol()}}
{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Session\+::protocol (\begin{DoxyParamCaption}\item[{std\+::string}]{data = {\ttfamily \char`\"{}\char`\"{}} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [protected]}, {\ttfamily [virtual]}}

Override the protocol method to manage and control the session communications in your inherited session. If you do not override this method then the Session default will process the \textquotesingle{}commands\textquotesingle{} added to the server object using the process\+Request method on the session input.

When data is received within the session two modes are available to pass the data through the protocol method\+: L\+I\+NE or B\+L\+O\+CK. 

Reimplemented in \mbox{\hyperlink{classcore_1_1_t_l_s_session_a547c436ab69f75307f065eca8cfcd109}{core\+::\+T\+L\+S\+Session}}, and \mbox{\hyperlink{classcore_1_1_console_session_a830cc1e1e0c3fe3b066f0a9f7f469490}{core\+::\+Console\+Session}}.

\mbox{\Hypertarget{classcore_1_1_t_c_p_session_a2b09eeafef5e44009a77d9da43e3b889}\label{classcore_1_1_t_c_p_session_a2b09eeafef5e44009a77d9da43e3b889}} 
\index{core::TCPSession@{core::TCPSession}!send@{send}}
\index{send@{send}!core::TCPSession@{core::TCPSession}}
\doxysubsubsection{\texorpdfstring{send()}{send()}}
{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Session\+::send (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

The send method is used to output the contents of the out stream to the session containing the stream. \mbox{\Hypertarget{classcore_1_1_t_c_p_session_afdfe135694c6689f5365fac6c090ec33}\label{classcore_1_1_t_c_p_session_afdfe135694c6689f5365fac6c090ec33}} 
\index{core::TCPSession@{core::TCPSession}!sendToAll@{sendToAll}}
\index{sendToAll@{sendToAll}!core::TCPSession@{core::TCPSession}}
\doxysubsubsection{\texorpdfstring{sendToAll()}{sendToAll()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Session\+::send\+To\+All (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

Use this send\+To\+All method to output the contents of the out stream to all the connections on the server excluding the sender session. \mbox{\Hypertarget{classcore_1_1_t_c_p_session_a05c489dcd2ebd74f527864759929e351}\label{classcore_1_1_t_c_p_session_a05c489dcd2ebd74f527864759929e351}} 
\index{core::TCPSession@{core::TCPSession}!sendToAll@{sendToAll}}
\index{sendToAll@{sendToAll}!core::TCPSession@{core::TCPSession}}
\doxysubsubsection{\texorpdfstring{sendToAll()}{sendToAll()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Session\+::send\+To\+All (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classcore_1_1_session_filter}{Session\+Filter}}}]{filter }\end{DoxyParamCaption})}

Use this send\+To\+All method to output the contents of the out stream to all the connections on the server excluding the sender session and the entries identified by the passed in filter object. \mbox{\Hypertarget{classcore_1_1_t_c_p_session_ad76c57be6769fc68b551b5212141e801}\label{classcore_1_1_t_c_p_session_ad76c57be6769fc68b551b5212141e801}} 
\index{core::TCPSession@{core::TCPSession}!setMode@{setMode}}
\index{setMode@{setMode}!core::TCPSession@{core::TCPSession}}
\doxysubsubsection{\texorpdfstring{setMode()}{setMode()}}
{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Session\+::set\+Mode (\begin{DoxyParamCaption}\item[{Mode}]{mode,  }\item[{int}]{size = {\ttfamily 0} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [protected]}}

Use the set\+Mode method to set the receiving mode for the data on this socket. Data can be received in L\+I\+NE mode, which will receive data from the socket one line at a time, or B\+L\+O\+CK mode where a certain specified data block is received before calling the on\+Block\+Received method. \mbox{\Hypertarget{classcore_1_1_t_c_p_session_a34936745e8d7669d5400e78d353a56d3}\label{classcore_1_1_t_c_p_session_a34936745e8d7669d5400e78d353a56d3}} 
\index{core::TCPSession@{core::TCPSession}!terminate@{terminate}}
\index{terminate@{terminate}!core::TCPSession@{core::TCPSession}}
\doxysubsubsection{\texorpdfstring{terminate()}{terminate()}}
{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Session\+::terminate (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

Use this method to terminate this \mbox{\hyperlink{classcore_1_1_t_c_p_session}{T\+C\+P\+Session}}. 

\doxysubsection{Member Data Documentation}
\mbox{\Hypertarget{classcore_1_1_t_c_p_session_a2c39191d695d79891989ea628f42c0a8}\label{classcore_1_1_t_c_p_session_a2c39191d695d79891989ea628f42c0a8}} 
\index{core::TCPSession@{core::TCPSession}!grab@{grab}}
\index{grab@{grab}!core::TCPSession@{core::TCPSession}}
\doxysubsubsection{\texorpdfstring{grab}{grab}}
{\footnotesize\ttfamily \mbox{\hyperlink{classcore_1_1_command}{Command}}$\ast$ core\+::\+T\+C\+P\+Session\+::grab = N\+U\+LL}

\mbox{\Hypertarget{classcore_1_1_t_c_p_session_abb302bbb3d7e7bc75490c736364f0d4d}\label{classcore_1_1_t_c_p_session_abb302bbb3d7e7bc75490c736364f0d4d}} 
\index{core::TCPSession@{core::TCPSession}!out@{out}}
\index{out@{out}!core::TCPSession@{core::TCPSession}}
\doxysubsubsection{\texorpdfstring{out}{out}}
{\footnotesize\ttfamily std\+::stringstream core\+::\+T\+C\+P\+Session\+::out}

Use out to send data to the session socket or other session sockets. \mbox{\Hypertarget{classcore_1_1_t_c_p_session_a265d9493fa544e601b5ad5fb1663340c}\label{classcore_1_1_t_c_p_session_a265d9493fa544e601b5ad5fb1663340c}} 
\index{core::TCPSession@{core::TCPSession}!server@{server}}
\index{server@{server}!core::TCPSession@{core::TCPSession}}
\doxysubsubsection{\texorpdfstring{server}{server}}
{\footnotesize\ttfamily \mbox{\hyperlink{classcore_1_1_t_c_p_server}{T\+C\+P\+Server}}\& core\+::\+T\+C\+P\+Session\+::server}



The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{_t_c_p_session_8h}{T\+C\+P\+Session.\+h}}\item 
\mbox{\hyperlink{_t_c_p_session_8cpp}{T\+C\+P\+Session.\+cpp}}\end{DoxyCompactItemize}
