164 lines
12 KiB
TeX
164 lines
12 KiB
TeX
\hypertarget{classcore_1_1TCPSession}{}\section{core\+:\+:T\+C\+P\+Session Class Reference}
|
|
\label{classcore_1_1TCPSession}\index{core\+::\+T\+C\+P\+Session@{core\+::\+T\+C\+P\+Session}}
|
|
|
|
|
|
{\ttfamily \#include $<$T\+C\+P\+Session.\+h$>$}
|
|
|
|
|
|
|
|
Inheritance diagram for core\+:\+:T\+C\+P\+Session\+:\nopagebreak
|
|
\begin{figure}[H]
|
|
\begin{center}
|
|
\leavevmode
|
|
\includegraphics[width=194pt]{classcore_1_1TCPSession__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_1TCPSession__coll__graph}
|
|
\end{center}
|
|
\end{figure}
|
|
\subsection*{Public Member Functions}
|
|
\begin{DoxyCompactItemize}
|
|
\item
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession_a66e485cd2ba804e6ee4ac11eba3e4fa0}\label{classcore_1_1TCPSession_a66e485cd2ba804e6ee4ac11eba3e4fa0}}
|
|
{\bfseries T\+C\+P\+Session} (\hyperlink{classcore_1_1EPoll}{E\+Poll} \&e\+Poll, \hyperlink{classcore_1_1TCPServer}{T\+C\+P\+Server} \&server)
|
|
\item
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession_aad593104afcfaabef3c965fe5e0a9dd5}\label{classcore_1_1TCPSession_aad593104afcfaabef3c965fe5e0a9dd5}}
|
|
{\bfseries T\+C\+P\+Session} (\hyperlink{classcore_1_1EPoll}{E\+Poll} \&e\+Poll, \hyperlink{classcore_1_1TCPServer}{T\+C\+P\+Server} \&server, std\+::string text)
|
|
\item
|
|
virtual void \hyperlink{classcore_1_1TCPSession_a50037cbfc515650e04054e5481785981}{output} (std\+::stringstream \&data)
|
|
\item
|
|
void \hyperlink{classcore_1_1TCPSession_ae86d38bd7b58bfb8f8a22c1e2354c3df}{send} (std\+::string data)
|
|
\item
|
|
void \hyperlink{classcore_1_1TCPSession_aae6bcaf66594f92984e6419b14e8221f}{send\+To\+All} (std\+::string data)
|
|
\item
|
|
void \hyperlink{classcore_1_1TCPSession_a2219e98dc33f9da2fec1d75597081dfb}{send\+To\+All} (\hyperlink{classcore_1_1SessionFilter}{Session\+Filter} filter, std\+::string data)
|
|
\end{DoxyCompactItemize}
|
|
\subsection*{Public Attributes}
|
|
\begin{DoxyCompactItemize}
|
|
\item
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession_a2c39191d695d79891989ea628f42c0a8}\label{classcore_1_1TCPSession_a2c39191d695d79891989ea628f42c0a8}}
|
|
\hyperlink{classcore_1_1Command}{Command} $\ast$ {\bfseries grab} = N\+U\+LL
|
|
\item
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession_a265d9493fa544e601b5ad5fb1663340c}\label{classcore_1_1TCPSession_a265d9493fa544e601b5ad5fb1663340c}}
|
|
\hyperlink{classcore_1_1TCPServer}{T\+C\+P\+Server} \& {\bfseries server}
|
|
\end{DoxyCompactItemize}
|
|
\subsection*{Protected Member Functions}
|
|
\begin{DoxyCompactItemize}
|
|
\item
|
|
virtual void \hyperlink{classcore_1_1TCPSession_aa87aca65cece02a107e7c288a925271f}{on\+Data\+Received} (std\+::string data) override
|
|
\begin{DoxyCompactList}\small\item\em Called when data is received from the socket. \end{DoxyCompactList}\item
|
|
virtual void \hyperlink{classcore_1_1TCPSession_a77600a18d75f1efee00b3dc626b1e98b}{on\+Register} () override
|
|
\begin{DoxyCompactList}\small\item\em Called when the socket has finished registering with the epoll processing. \end{DoxyCompactList}\item
|
|
virtual void \hyperlink{classcore_1_1TCPSession_a8595f53d21b603a494d246b24dfa8be3}{on\+Connected} (std\+::stringstream \&out)
|
|
\item
|
|
virtual void \hyperlink{classcore_1_1TCPSession_aed35285cd2a2624bb219b51d3847634e}{protocol} (std\+::stringstream \&out, std\+::string data)
|
|
\end{DoxyCompactItemize}
|
|
\subsection*{Additional Inherited Members}
|
|
|
|
|
|
\subsection{Detailed Description}
|
|
\hyperlink{classcore_1_1TCPSession}{T\+C\+P\+Session}
|
|
|
|
\hyperlink{classcore_1_1TCPSession}{T\+C\+P\+Session} defines the nature of the interaction with the client and stores persistent data for a defined session. B\+M\+A\+Session objects are not sockets but instead provide a communications control mechanism. Protocol conversations are provided through extensions from this object.
|
|
|
|
\subsection{Member Function Documentation}
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession_a8595f53d21b603a494d246b24dfa8be3}\label{classcore_1_1TCPSession_a8595f53d21b603a494d246b24dfa8be3}}
|
|
\index{core\+::\+T\+C\+P\+Session@{core\+::\+T\+C\+P\+Session}!on\+Connected@{on\+Connected}}
|
|
\index{on\+Connected@{on\+Connected}!core\+::\+T\+C\+P\+Session@{core\+::\+T\+C\+P\+Session}}
|
|
\subsubsection{\texorpdfstring{on\+Connected()}{onConnected()}}
|
|
{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Session\+::on\+Connected (\begin{DoxyParamCaption}\item[{std\+::stringstream \&}]{out }\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_aa87aca65cece02a107e7c288a925271f}\label{classcore_1_1TCPSession_aa87aca65cece02a107e7c288a925271f}}
|
|
\index{core\+::\+T\+C\+P\+Session@{core\+::\+T\+C\+P\+Session}!on\+Data\+Received@{on\+Data\+Received}}
|
|
\index{on\+Data\+Received@{on\+Data\+Received}!core\+::\+T\+C\+P\+Session@{core\+::\+T\+C\+P\+Session}}
|
|
\subsubsection{\texorpdfstring{on\+Data\+Received()}{onDataReceived()}}
|
|
{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Session\+::on\+Data\+Received (\begin{DoxyParamCaption}\item[{std\+::string}]{data }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [protected]}, {\ttfamily [virtual]}}
|
|
|
|
|
|
|
|
Called when data is received from the socket.
|
|
|
|
The on\+Connected method is called when the socket is ready to communicate. Writing to the socket can begin on this call to initiate a contact with the remote device. The on\+Data\+Received method is called when the socket has received an event from epoll and there is data ready to be read from the socket. The default handler will pull the data and put it into the streambuf for the socket. E\+P\+O\+L\+L\+IN
|
|
|
|
|
|
\begin{DoxyParams}{Parameters}
|
|
{\em data} & the data that has been received from the socket. \\
|
|
\hline
|
|
\end{DoxyParams}
|
|
|
|
|
|
Reimplemented from \hyperlink{classcore_1_1Socket_ac8d6a2c54696eb6fc2024cf6bcf6b4e5}{core\+::\+Socket}.
|
|
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession_a77600a18d75f1efee00b3dc626b1e98b}\label{classcore_1_1TCPSession_a77600a18d75f1efee00b3dc626b1e98b}}
|
|
\index{core\+::\+T\+C\+P\+Session@{core\+::\+T\+C\+P\+Session}!on\+Register@{on\+Register}}
|
|
\index{on\+Register@{on\+Register}!core\+::\+T\+C\+P\+Session@{core\+::\+T\+C\+P\+Session}}
|
|
\subsubsection{\texorpdfstring{on\+Register()}{onRegister()}}
|
|
{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Session\+::on\+Register (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [protected]}, {\ttfamily [virtual]}}
|
|
|
|
|
|
|
|
Called when the socket has finished registering with the epoll processing.
|
|
|
|
The on\+Register method is called before the socket is registered with e\+Poll so objects extending the \hyperlink{classcore_1_1Socket}{Socket} definition can initialize the socket before receiving events. Evoked when the descriptor is set using set\+Descriptor for the socket.
|
|
|
|
Reimplemented from \hyperlink{classcore_1_1Socket_a81e5ee3e17834166d97c6e8b7dfe0da0}{core\+::\+Socket}.
|
|
|
|
|
|
|
|
Reimplemented in \hyperlink{classcore_1_1TLSSession_a76cec7cf4851eb27abe77a2339344c6d}{core\+::\+T\+L\+S\+Session}.
|
|
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession_a50037cbfc515650e04054e5481785981}\label{classcore_1_1TCPSession_a50037cbfc515650e04054e5481785981}}
|
|
\index{core\+::\+T\+C\+P\+Session@{core\+::\+T\+C\+P\+Session}!output@{output}}
|
|
\index{output@{output}!core\+::\+T\+C\+P\+Session@{core\+::\+T\+C\+P\+Session}}
|
|
\subsubsection{\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 \hyperlink{classcore_1_1TCPSocket_afacf7528ff3c9ac077d7b5a49e2116fd}{core\+::\+T\+C\+P\+Socket}.
|
|
|
|
|
|
|
|
Reimplemented in \hyperlink{classcore_1_1TLSSession_ae55de8a035d1ddc560cf619b2030af43}{core\+::\+T\+L\+S\+Session}.
|
|
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession_aed35285cd2a2624bb219b51d3847634e}\label{classcore_1_1TCPSession_aed35285cd2a2624bb219b51d3847634e}}
|
|
\index{core\+::\+T\+C\+P\+Session@{core\+::\+T\+C\+P\+Session}!protocol@{protocol}}
|
|
\index{protocol@{protocol}!core\+::\+T\+C\+P\+Session@{core\+::\+T\+C\+P\+Session}}
|
|
\subsubsection{\texorpdfstring{protocol()}{protocol()}}
|
|
{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Session\+::protocol (\begin{DoxyParamCaption}\item[{std\+::stringstream \&}]{out, }\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.
|
|
|
|
Reimplemented in \hyperlink{classcore_1_1TLSSession_ad7f219581d1f7700ca1f88551cd01c74}{core\+::\+T\+L\+S\+Session}, and \hyperlink{classcore_1_1ConsoleSession_a9fc306ab91d0f2a6990984040ecb3e47}{core\+::\+Console\+Session}.
|
|
|
|
\mbox{\Hypertarget{classcore_1_1TCPSession_ae86d38bd7b58bfb8f8a22c1e2354c3df}\label{classcore_1_1TCPSession_ae86d38bd7b58bfb8f8a22c1e2354c3df}}
|
|
\index{core\+::\+T\+C\+P\+Session@{core\+::\+T\+C\+P\+Session}!send@{send}}
|
|
\index{send@{send}!core\+::\+T\+C\+P\+Session@{core\+::\+T\+C\+P\+Session}}
|
|
\subsubsection{\texorpdfstring{send()}{send()}}
|
|
{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Session\+::send (\begin{DoxyParamCaption}\item[{std\+::string}]{data }\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_aae6bcaf66594f92984e6419b14e8221f}\label{classcore_1_1TCPSession_aae6bcaf66594f92984e6419b14e8221f}}
|
|
\index{core\+::\+T\+C\+P\+Session@{core\+::\+T\+C\+P\+Session}!send\+To\+All@{send\+To\+All}}
|
|
\index{send\+To\+All@{send\+To\+All}!core\+::\+T\+C\+P\+Session@{core\+::\+T\+C\+P\+Session}}
|
|
\subsubsection{\texorpdfstring{send\+To\+All()}{sendToAll()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
|
|
{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Session\+::send\+To\+All (\begin{DoxyParamCaption}\item[{std\+::string}]{data }\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_1TCPSession_a2219e98dc33f9da2fec1d75597081dfb}\label{classcore_1_1TCPSession_a2219e98dc33f9da2fec1d75597081dfb}}
|
|
\index{core\+::\+T\+C\+P\+Session@{core\+::\+T\+C\+P\+Session}!send\+To\+All@{send\+To\+All}}
|
|
\index{send\+To\+All@{send\+To\+All}!core\+::\+T\+C\+P\+Session@{core\+::\+T\+C\+P\+Session}}
|
|
\subsubsection{\texorpdfstring{send\+To\+All()}{sendToAll()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
|
|
{\footnotesize\ttfamily void core\+::\+T\+C\+P\+Session\+::send\+To\+All (\begin{DoxyParamCaption}\item[{\hyperlink{classcore_1_1SessionFilter}{Session\+Filter}}]{filter, }\item[{std\+::string}]{data }\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.
|
|
|
|
The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
|
|
\item
|
|
T\+C\+P\+Session.\+h\item
|
|
T\+C\+P\+Session.\+cpp\end{DoxyCompactItemize}
|