153 lines
11 KiB
TeX
153 lines
11 KiB
TeX
\hypertarget{classcore_1_1TCPSession2}{}\doxysection{core\+::TCPSession2 Class Reference}
|
|
\label{classcore_1_1TCPSession2}\index{core::TCPSession2@{core::TCPSession2}}
|
|
|
|
|
|
{\ttfamily \#include $<$TCPSession2.\+h$>$}
|
|
|
|
|
|
|
|
Inheritance diagram for core\+::TCPSession2\+:\nopagebreak
|
|
\begin{figure}[H]
|
|
\begin{center}
|
|
\leavevmode
|
|
\includegraphics[width=186pt]{classcore_1_1TCPSession2__inherit__graph}
|
|
\end{center}
|
|
\end{figure}
|
|
|
|
|
|
Collaboration diagram for core\+::TCPSession2\+:\nopagebreak
|
|
\begin{figure}[H]
|
|
\begin{center}
|
|
\leavevmode
|
|
\includegraphics[width=344pt]{classcore_1_1TCPSession2__coll__graph}
|
|
\end{center}
|
|
\end{figure}
|
|
\doxysubsection*{Public Member Functions}
|
|
\begin{DoxyCompactItemize}
|
|
\item
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession2_a1802e408a99b1a821b6cfc3fb64e083a}\label{classcore_1_1TCPSession2_a1802e408a99b1a821b6cfc3fb64e083a}}
|
|
{\bfseries TCPSession2} (\mbox{\hyperlink{classcore_1_1EPoll}{EPoll}} \&e\+Poll, std\+::string text=\char`\"{}\char`\"{})
|
|
\item
|
|
virtual void \mbox{\hyperlink{classcore_1_1TCPSession2_ae7648a7759570a00d3d4a8c169183291}{output}} (std\+::stringstream \&data)
|
|
\item
|
|
void \mbox{\hyperlink{classcore_1_1TCPSession2_aca2f7127b4081fa0e2d2d128083fb0f7}{send}} ()
|
|
\item
|
|
void \mbox{\hyperlink{classcore_1_1TCPSession2_a6b999e7ea6551a1b513ee057afaa9e4a}{terminate}} ()
|
|
\end{DoxyCompactItemize}
|
|
\doxysubsection*{Public Attributes}
|
|
\begin{DoxyCompactItemize}
|
|
\item
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession2_a1d0170cac9acda04f66971b843660676}\label{classcore_1_1TCPSession2_a1d0170cac9acda04f66971b843660676}}
|
|
\mbox{\hyperlink{classcore_1_1Command}{Command}} $\ast$ {\bfseries grab} = NULL
|
|
\item
|
|
std\+::stringstream \mbox{\hyperlink{classcore_1_1TCPSession2_a6b8005e611b6007a00ad3288973a522d}{out}}
|
|
\end{DoxyCompactItemize}
|
|
\doxysubsection*{Protected Member Functions}
|
|
\begin{DoxyCompactItemize}
|
|
\item
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession2_a76096659b82c5dcbf6eac1d916511e60}\label{classcore_1_1TCPSession2_a76096659b82c5dcbf6eac1d916511e60}}
|
|
virtual void \mbox{\hyperlink{classcore_1_1TCPSession2_a76096659b82c5dcbf6eac1d916511e60}{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_1TCPSession2_a67c473e1a22b10fc100ae54206f7471b}{on\+Data\+Received}} (coreutils\+::\+ZString \&data) override
|
|
\item
|
|
virtual void \mbox{\hyperlink{classcore_1_1TCPSession2_a6cd36b444d9548d1024190c6ba747e18}{on\+Line\+Received}} (coreutils\+::\+ZString \&line)
|
|
\item
|
|
virtual void \mbox{\hyperlink{classcore_1_1TCPSession2_a6c88775e81dc0074ef0832146be9f4b9}{on\+Block\+Received}} (coreutils\+::\+ZString \&block)
|
|
\item
|
|
virtual void \mbox{\hyperlink{classcore_1_1TCPSession2_af1913cb444a9e07c0f31a2cd8d934a62}{on\+Connected}} ()
|
|
\item
|
|
virtual void \mbox{\hyperlink{classcore_1_1TCPSession2_a45df5db21355bf7d3585d68789b371ce}{protocol}} (coreutils\+::\+ZString \&data)
|
|
\item
|
|
void \mbox{\hyperlink{classcore_1_1TCPSession2_a6f4ed04cd2848e5b903b8331b2e951c8}{set\+Block\+Size}} (int size=0)
|
|
\end{DoxyCompactItemize}
|
|
\doxysubsection*{Additional Inherited Members}
|
|
|
|
|
|
\doxysubsection{Detailed Description}
|
|
\mbox{\hyperlink{classcore_1_1TCPSession2}{TCPSession2}}
|
|
|
|
\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.
|
|
|
|
\mbox{\hyperlink{classcore_1_1TCPSession2}{TCPSession2}} is designed to be \textquotesingle{}connected\textquotesingle{} instead of being served by a server.
|
|
|
|
\doxysubsection{Member Function Documentation}
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession2_a6c88775e81dc0074ef0832146be9f4b9}\label{classcore_1_1TCPSession2_a6c88775e81dc0074ef0832146be9f4b9}}
|
|
\index{core::TCPSession2@{core::TCPSession2}!onBlockReceived@{onBlockReceived}}
|
|
\index{onBlockReceived@{onBlockReceived}!core::TCPSession2@{core::TCPSession2}}
|
|
\doxysubsubsection{\texorpdfstring{onBlockReceived()}{onBlockReceived()}}
|
|
{\footnotesize\ttfamily void core\+::\+TCPSession2\+::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_1TCPSession2_af1913cb444a9e07c0f31a2cd8d934a62}\label{classcore_1_1TCPSession2_af1913cb444a9e07c0f31a2cd8d934a62}}
|
|
\index{core::TCPSession2@{core::TCPSession2}!onConnected@{onConnected}}
|
|
\index{onConnected@{onConnected}!core::TCPSession2@{core::TCPSession2}}
|
|
\doxysubsubsection{\texorpdfstring{onConnected()}{onConnected()}}
|
|
{\footnotesize\ttfamily void core\+::\+TCPSession2\+::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_1TCPSession2_a67c473e1a22b10fc100ae54206f7471b}\label{classcore_1_1TCPSession2_a67c473e1a22b10fc100ae54206f7471b}}
|
|
\index{core::TCPSession2@{core::TCPSession2}!onDataReceived@{onDataReceived}}
|
|
\index{onDataReceived@{onDataReceived}!core::TCPSession2@{core::TCPSession2}}
|
|
\doxysubsubsection{\texorpdfstring{onDataReceived()}{onDataReceived()}}
|
|
{\footnotesize\ttfamily void core\+::\+TCPSession2\+::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_1TCPSession2_a6cd36b444d9548d1024190c6ba747e18}\label{classcore_1_1TCPSession2_a6cd36b444d9548d1024190c6ba747e18}}
|
|
\index{core::TCPSession2@{core::TCPSession2}!onLineReceived@{onLineReceived}}
|
|
\index{onLineReceived@{onLineReceived}!core::TCPSession2@{core::TCPSession2}}
|
|
\doxysubsubsection{\texorpdfstring{onLineReceived()}{onLineReceived()}}
|
|
{\footnotesize\ttfamily void core\+::\+TCPSession2\+::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_1TCPSession2_ae7648a7759570a00d3d4a8c169183291}\label{classcore_1_1TCPSession2_ae7648a7759570a00d3d4a8c169183291}}
|
|
\index{core::TCPSession2@{core::TCPSession2}!output@{output}}
|
|
\index{output@{output}!core::TCPSession2@{core::TCPSession2}}
|
|
\doxysubsubsection{\texorpdfstring{output()}{output()}}
|
|
{\footnotesize\ttfamily void core\+::\+TCPSession2\+::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}}.
|
|
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession2_a45df5db21355bf7d3585d68789b371ce}\label{classcore_1_1TCPSession2_a45df5db21355bf7d3585d68789b371ce}}
|
|
\index{core::TCPSession2@{core::TCPSession2}!protocol@{protocol}}
|
|
\index{protocol@{protocol}!core::TCPSession2@{core::TCPSession2}}
|
|
\doxysubsubsection{\texorpdfstring{protocol()}{protocol()}}
|
|
{\footnotesize\ttfamily void core\+::\+TCPSession2\+::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. \mbox{\Hypertarget{classcore_1_1TCPSession2_aca2f7127b4081fa0e2d2d128083fb0f7}\label{classcore_1_1TCPSession2_aca2f7127b4081fa0e2d2d128083fb0f7}}
|
|
\index{core::TCPSession2@{core::TCPSession2}!send@{send}}
|
|
\index{send@{send}!core::TCPSession2@{core::TCPSession2}}
|
|
\doxysubsubsection{\texorpdfstring{send()}{send()}}
|
|
{\footnotesize\ttfamily void core\+::\+TCPSession2\+::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_1TCPSession2_a6f4ed04cd2848e5b903b8331b2e951c8}\label{classcore_1_1TCPSession2_a6f4ed04cd2848e5b903b8331b2e951c8}}
|
|
\index{core::TCPSession2@{core::TCPSession2}!setBlockSize@{setBlockSize}}
|
|
\index{setBlockSize@{setBlockSize}!core::TCPSession2@{core::TCPSession2}}
|
|
\doxysubsubsection{\texorpdfstring{setBlockSize()}{setBlockSize()}}
|
|
{\footnotesize\ttfamily void core\+::\+TCPSession2\+::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_1TCPSession2_a6b999e7ea6551a1b513ee057afaa9e4a}\label{classcore_1_1TCPSession2_a6b999e7ea6551a1b513ee057afaa9e4a}}
|
|
\index{core::TCPSession2@{core::TCPSession2}!terminate@{terminate}}
|
|
\index{terminate@{terminate}!core::TCPSession2@{core::TCPSession2}}
|
|
\doxysubsubsection{\texorpdfstring{terminate()}{terminate()}}
|
|
{\footnotesize\ttfamily void core\+::\+TCPSession2\+::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_1TCPSession2_a6b8005e611b6007a00ad3288973a522d}\label{classcore_1_1TCPSession2_a6b8005e611b6007a00ad3288973a522d}}
|
|
\index{core::TCPSession2@{core::TCPSession2}!out@{out}}
|
|
\index{out@{out}!core::TCPSession2@{core::TCPSession2}}
|
|
\doxysubsubsection{\texorpdfstring{out}{out}}
|
|
{\footnotesize\ttfamily std\+::stringstream core\+::\+TCPSession2\+::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
|
|
TCPSession2.\+h\item
|
|
TCPSession2.\+cpp\end{DoxyCompactItemize}
|