162 lines
12 KiB
TeX
162 lines
12 KiB
TeX
\hypertarget{classcore_1_1TCPSession}{}\doxysection{core\+::TCPSession Class Reference}
|
|
\label{classcore_1_1TCPSession}\index{core::TCPSession@{core::TCPSession}}
|
|
|
|
|
|
{\ttfamily \#include $<$TCPSession.\+h$>$}
|
|
|
|
|
|
|
|
Inheritance diagram for core\+::TCPSession\+:\nopagebreak
|
|
\begin{figure}[H]
|
|
\begin{center}
|
|
\leavevmode
|
|
\includegraphics[width=320pt]{classcore_1_1TCPSession__inherit__graph}
|
|
\end{center}
|
|
\end{figure}
|
|
|
|
|
|
Collaboration diagram for core\+::TCPSession\+:\nopagebreak
|
|
\begin{figure}[H]
|
|
\begin{center}
|
|
\leavevmode
|
|
\includegraphics[width=350pt]{classcore_1_1TCPSession__coll__graph}
|
|
\end{center}
|
|
\end{figure}
|
|
\doxysubsection*{Public Member Functions}
|
|
\begin{DoxyCompactItemize}
|
|
\item
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession_a7e1192babcdeb688f463d3e9e85d0979}\label{classcore_1_1TCPSession_a7e1192babcdeb688f463d3e9e85d0979}}
|
|
{\bfseries TCPSession} (\mbox{\hyperlink{classcore_1_1EPoll}{EPoll}} \&e\+Poll, \mbox{\hyperlink{classcore_1_1TCPServer}{TCPServer}} \&server, std\+::string text=\char`\"{}\char`\"{})
|
|
\item
|
|
virtual void \mbox{\hyperlink{classcore_1_1TCPSession_a50037cbfc515650e04054e5481785981}{output}} (std\+::stringstream \&data)
|
|
\item
|
|
void \mbox{\hyperlink{classcore_1_1TCPSession_a2b09eeafef5e44009a77d9da43e3b889}{send}} ()
|
|
\item
|
|
void \mbox{\hyperlink{classcore_1_1TCPSession_a34936745e8d7669d5400e78d353a56d3}{terminate}} ()
|
|
\end{DoxyCompactItemize}
|
|
\doxysubsection*{Public Attributes}
|
|
\begin{DoxyCompactItemize}
|
|
\item
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession_a2c39191d695d79891989ea628f42c0a8}\label{classcore_1_1TCPSession_a2c39191d695d79891989ea628f42c0a8}}
|
|
\mbox{\hyperlink{classcore_1_1Command}{Command}} $\ast$ {\bfseries grab} = NULL
|
|
\item
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession_a265d9493fa544e601b5ad5fb1663340c}\label{classcore_1_1TCPSession_a265d9493fa544e601b5ad5fb1663340c}}
|
|
\mbox{\hyperlink{classcore_1_1TCPServer}{TCPServer}} \& {\bfseries server}
|
|
\item
|
|
std\+::stringstream \mbox{\hyperlink{classcore_1_1TCPSession_abb302bbb3d7e7bc75490c736364f0d4d}{out}}
|
|
\end{DoxyCompactItemize}
|
|
\doxysubsection*{Protected Member Functions}
|
|
\begin{DoxyCompactItemize}
|
|
\item
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession_aed4ed499b978bcea57a8efefe929fc98}\label{classcore_1_1TCPSession_aed4ed499b978bcea57a8efefe929fc98}}
|
|
virtual void \mbox{\hyperlink{classcore_1_1TCPSession_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_1TCPSession_afc2d2a92bc65e1e5122a93d120253a1d}{on\+Data\+Received}} (coreutils\+::\+ZString \&data) override
|
|
\item
|
|
virtual void \mbox{\hyperlink{classcore_1_1TCPSession_a3d9e0f14e7d24357fd1950b3f9b4eaff}{on\+Line\+Received}} (coreutils\+::\+ZString \&line)
|
|
\item
|
|
virtual void \mbox{\hyperlink{classcore_1_1TCPSession_a9c996cbbfa2e592c23cf67ed8b15a32a}{on\+Block\+Received}} (coreutils\+::\+ZString \&block)
|
|
\item
|
|
virtual void \mbox{\hyperlink{classcore_1_1TCPSession_a8719952f7bb00bf7239ec40aa2868626}{on\+Connected}} ()
|
|
\item
|
|
virtual void \mbox{\hyperlink{classcore_1_1TCPSession_a98a65da2346b79bee659fca6902e94c7}{protocol}} (coreutils\+::\+ZString \&data)
|
|
\item
|
|
void \mbox{\hyperlink{classcore_1_1TCPSession_a836fb3fd5ee543ebc93262a980ae88b5}{set\+Block\+Size}} (int size=0)
|
|
\end{DoxyCompactItemize}
|
|
\doxysubsection*{Additional Inherited Members}
|
|
|
|
|
|
\doxysubsection{Detailed Description}
|
|
\mbox{\hyperlink{classcore_1_1TCPSession}{TCPSession}}
|
|
|
|
\mbox{\hyperlink{classcore_1_1TCPSession}{TCPSession}} defines the nature of the interaction with the client and stores persistent data for a defined session. \mbox{\hyperlink{classcore_1_1TCPSession}{TCPSession}} objects are not sockets but instead provide a communications control mechanism. Protocol conversations are provided through extensions from this object.
|
|
|
|
\doxysubsection{Member Function Documentation}
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession_a9c996cbbfa2e592c23cf67ed8b15a32a}\label{classcore_1_1TCPSession_a9c996cbbfa2e592c23cf67ed8b15a32a}}
|
|
\index{core::TCPSession@{core::TCPSession}!onBlockReceived@{onBlockReceived}}
|
|
\index{onBlockReceived@{onBlockReceived}!core::TCPSession@{core::TCPSession}}
|
|
\doxysubsubsection{\texorpdfstring{onBlockReceived()}{onBlockReceived()}}
|
|
{\footnotesize\ttfamily void core\+::\+TCPSession\+::on\+Block\+Received (\begin{DoxyParamCaption}\item[{coreutils\+::\+ZString \&}]{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_1TCPSession_a8719952f7bb00bf7239ec40aa2868626}\label{classcore_1_1TCPSession_a8719952f7bb00bf7239ec40aa2868626}}
|
|
\index{core::TCPSession@{core::TCPSession}!onConnected@{onConnected}}
|
|
\index{onConnected@{onConnected}!core::TCPSession@{core::TCPSession}}
|
|
\doxysubsubsection{\texorpdfstring{onConnected()}{onConnected()}}
|
|
{\footnotesize\ttfamily void core\+::\+TCPSession\+::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_1TCPSession_afc2d2a92bc65e1e5122a93d120253a1d}\label{classcore_1_1TCPSession_afc2d2a92bc65e1e5122a93d120253a1d}}
|
|
\index{core::TCPSession@{core::TCPSession}!onDataReceived@{onDataReceived}}
|
|
\index{onDataReceived@{onDataReceived}!core::TCPSession@{core::TCPSession}}
|
|
\doxysubsubsection{\texorpdfstring{onDataReceived()}{onDataReceived()}}
|
|
{\footnotesize\ttfamily void core\+::\+TCPSession\+::on\+Data\+Received (\begin{DoxyParamCaption}\item[{coreutils\+::\+ZString \&}]{data }\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_1Socket}{core\+::\+Socket}}.
|
|
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession_a3d9e0f14e7d24357fd1950b3f9b4eaff}\label{classcore_1_1TCPSession_a3d9e0f14e7d24357fd1950b3f9b4eaff}}
|
|
\index{core::TCPSession@{core::TCPSession}!onLineReceived@{onLineReceived}}
|
|
\index{onLineReceived@{onLineReceived}!core::TCPSession@{core::TCPSession}}
|
|
\doxysubsubsection{\texorpdfstring{onLineReceived()}{onLineReceived()}}
|
|
{\footnotesize\ttfamily void core\+::\+TCPSession\+::on\+Line\+Received (\begin{DoxyParamCaption}\item[{coreutils\+::\+ZString \&}]{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 CRLF. 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_1TCPSession_a50037cbfc515650e04054e5481785981}\label{classcore_1_1TCPSession_a50037cbfc515650e04054e5481785981}}
|
|
\index{core::TCPSession@{core::TCPSession}!output@{output}}
|
|
\index{output@{output}!core::TCPSession@{core::TCPSession}}
|
|
\doxysubsubsection{\texorpdfstring{output()}{output()}}
|
|
{\footnotesize\ttfamily void core\+::\+TCPSession\+::output (\begin{DoxyParamCaption}\item[{std\+::stringstream \&}]{out }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}
|
|
|
|
The output method is called by a socket session (\mbox{\hyperlink{classcore_1_1TCPSession}{TCPSession}}) and will output the detail information for the client socket. When extending BMATCPSocket or BMASession you can override the method to add attributes to the list.
|
|
|
|
Reimplemented from \mbox{\hyperlink{classcore_1_1TCPSocket_afacf7528ff3c9ac077d7b5a49e2116fd}{core\+::\+TCPSocket}}.
|
|
|
|
|
|
|
|
Reimplemented in \mbox{\hyperlink{classcore_1_1TLSSession_ae55de8a035d1ddc560cf619b2030af43}{core\+::\+TLSSession}}.
|
|
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession_a98a65da2346b79bee659fca6902e94c7}\label{classcore_1_1TCPSession_a98a65da2346b79bee659fca6902e94c7}}
|
|
\index{core::TCPSession@{core::TCPSession}!protocol@{protocol}}
|
|
\index{protocol@{protocol}!core::TCPSession@{core::TCPSession}}
|
|
\doxysubsubsection{\texorpdfstring{protocol()}{protocol()}}
|
|
{\footnotesize\ttfamily void core\+::\+TCPSession\+::protocol (\begin{DoxyParamCaption}\item[{coreutils\+::\+ZString \&}]{data }\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\+: LINE or BLOCK.
|
|
|
|
Reimplemented in \mbox{\hyperlink{classcore_1_1TLSSession_a208145cc1fcdc14054602aacc2c51d91}{core\+::\+TLSSession}}, and \mbox{\hyperlink{classcore_1_1ConsoleSession_aa1818efcd33a4152d2089aa545f08833}{core\+::\+Console\+Session}}.
|
|
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession_a2b09eeafef5e44009a77d9da43e3b889}\label{classcore_1_1TCPSession_a2b09eeafef5e44009a77d9da43e3b889}}
|
|
\index{core::TCPSession@{core::TCPSession}!send@{send}}
|
|
\index{send@{send}!core::TCPSession@{core::TCPSession}}
|
|
\doxysubsubsection{\texorpdfstring{send()}{send()}}
|
|
{\footnotesize\ttfamily void core\+::\+TCPSession\+::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_1TCPSession_a836fb3fd5ee543ebc93262a980ae88b5}\label{classcore_1_1TCPSession_a836fb3fd5ee543ebc93262a980ae88b5}}
|
|
\index{core::TCPSession@{core::TCPSession}!setBlockSize@{setBlockSize}}
|
|
\index{setBlockSize@{setBlockSize}!core::TCPSession@{core::TCPSession}}
|
|
\doxysubsubsection{\texorpdfstring{setBlockSize()}{setBlockSize()}}
|
|
{\footnotesize\ttfamily void core\+::\+TCPSession\+::set\+Block\+Size (\begin{DoxyParamCaption}\item[{int}]{size = {\ttfamily 0} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [protected]}}
|
|
|
|
Use set\+Block\+Size to set the amount of data that should be read at once from the session data buffer. If this value is set to 0 then the data will be retrieved \mbox{\Hypertarget{classcore_1_1TCPSession_a34936745e8d7669d5400e78d353a56d3}\label{classcore_1_1TCPSession_a34936745e8d7669d5400e78d353a56d3}}
|
|
\index{core::TCPSession@{core::TCPSession}!terminate@{terminate}}
|
|
\index{terminate@{terminate}!core::TCPSession@{core::TCPSession}}
|
|
\doxysubsubsection{\texorpdfstring{terminate()}{terminate()}}
|
|
{\footnotesize\ttfamily void core\+::\+TCPSession\+::terminate (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}
|
|
|
|
Use this method to terminate this \mbox{\hyperlink{classcore_1_1TCPSession}{TCPSession}}.
|
|
|
|
\doxysubsection{Member Data Documentation}
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession_abb302bbb3d7e7bc75490c736364f0d4d}\label{classcore_1_1TCPSession_abb302bbb3d7e7bc75490c736364f0d4d}}
|
|
\index{core::TCPSession@{core::TCPSession}!out@{out}}
|
|
\index{out@{out}!core::TCPSession@{core::TCPSession}}
|
|
\doxysubsubsection{\texorpdfstring{out}{out}}
|
|
{\footnotesize\ttfamily std\+::stringstream core\+::\+TCPSession\+::out}
|
|
|
|
Use out to send data to the session socket or other session sockets.
|
|
|
|
The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
|
|
\item
|
|
TCPSession.\+h\item
|
|
TCPSession.\+cpp\end{DoxyCompactItemize}
|