\hypertarget{class_b_m_a_t_c_p_server_socket}{}\section{B\+M\+A\+T\+C\+P\+Server\+Socket Class Reference}
\label{class_b_m_a_t_c_p_server_socket}\index{B\+M\+A\+T\+C\+P\+Server\+Socket@{B\+M\+A\+T\+C\+P\+Server\+Socket}}


{\ttfamily \#include $<$B\+M\+A\+T\+C\+P\+Server\+Socket.\+h$>$}



Inheritance diagram for B\+M\+A\+T\+C\+P\+Server\+Socket\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=318pt]{class_b_m_a_t_c_p_server_socket__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for B\+M\+A\+T\+C\+P\+Server\+Socket\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{class_b_m_a_t_c_p_server_socket__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_b_m_a_t_c_p_server_socket_a48e6fa160a86accb51f81724c3af51fd}{B\+M\+A\+T\+C\+P\+Server\+Socket} (\hyperlink{class_b_m_a_e_poll}{B\+M\+A\+E\+Poll} \&e\+Poll, std\+::string url, short int port, std\+::string command\+Name)
\item 
\hyperlink{class_b_m_a_t_c_p_server_socket_a32383b879e9464c955adab2c7bb33fc2}{$\sim$\+B\+M\+A\+T\+C\+P\+Server\+Socket} ()
\item 
\mbox{\Hypertarget{class_b_m_a_t_c_p_server_socket_ac2f4d28d9485cf150cfa73841d824969}\label{class_b_m_a_t_c_p_server_socket_ac2f4d28d9485cf150cfa73841d824969}} 
void {\bfseries remove\+From\+Session\+List} (\hyperlink{class_b_m_a_session}{B\+M\+A\+Session} $\ast$session)
\end{DoxyCompactItemize}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
std\+::vector$<$ \hyperlink{class_b_m_a_session}{B\+M\+A\+Session} $\ast$ $>$ \hyperlink{class_b_m_a_t_c_p_server_socket_a8719aeb1b87b9f0d7e0b38aa28ab9a35}{sessions}
\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{class_b_m_a_t_c_p_server_socket_aa452d52a1f26dfa36eea10f13f79979c}\label{class_b_m_a_t_c_p_server_socket_aa452d52a1f26dfa36eea10f13f79979c}} 
virtual void {\bfseries init} ()
\item 
virtual \hyperlink{class_b_m_a_session}{B\+M\+A\+Session} $\ast$ \hyperlink{class_b_m_a_t_c_p_server_socket_a5eb805883d7a496be0a1cbc81c09c145}{get\+Socket\+Accept} ()=0
\item 
void \hyperlink{class_b_m_a_t_c_p_server_socket_ae562db0627e31f558189a4140a9d0a36}{on\+Data\+Received} (std\+::string data) override
\item 
void \hyperlink{class_b_m_a_t_c_p_server_socket_afb337fa6ec678ce45b1c58ca8a20768a}{process\+Command} (std\+::string command, \hyperlink{class_b_m_a_session}{B\+M\+A\+Session} $\ast$session) override
\end{DoxyCompactItemize}
\subsection*{Additional Inherited Members}


\subsection{Detailed Description}
\hyperlink{class_b_m_a_t_c_p_server_socket}{B\+M\+A\+T\+C\+P\+Server\+Socket}

Manage a socket connection as a T\+CP server type. Connections to the socket are processed through the accept functionality.

A list of connections is maintained in a vector object.

This object extends the \hyperlink{class_b_m_a_command}{B\+M\+A\+Command} object as well so it can be added to a B\+M\+A\+Console object and process commands to display status information. 

\subsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{class_b_m_a_t_c_p_server_socket_a48e6fa160a86accb51f81724c3af51fd}\label{class_b_m_a_t_c_p_server_socket_a48e6fa160a86accb51f81724c3af51fd}} 
\index{B\+M\+A\+T\+C\+P\+Server\+Socket@{B\+M\+A\+T\+C\+P\+Server\+Socket}!B\+M\+A\+T\+C\+P\+Server\+Socket@{B\+M\+A\+T\+C\+P\+Server\+Socket}}
\index{B\+M\+A\+T\+C\+P\+Server\+Socket@{B\+M\+A\+T\+C\+P\+Server\+Socket}!B\+M\+A\+T\+C\+P\+Server\+Socket@{B\+M\+A\+T\+C\+P\+Server\+Socket}}
\subsubsection{\texorpdfstring{B\+M\+A\+T\+C\+P\+Server\+Socket()}{BMATCPServerSocket()}}
{\footnotesize\ttfamily B\+M\+A\+T\+C\+P\+Server\+Socket\+::\+B\+M\+A\+T\+C\+P\+Server\+Socket (\begin{DoxyParamCaption}\item[{\hyperlink{class_b_m_a_e_poll}{B\+M\+A\+E\+Poll} \&}]{e\+Poll,  }\item[{std\+::string}]{url,  }\item[{short int}]{port,  }\item[{std\+::string}]{command\+Name }\end{DoxyParamCaption})}

The constructor for the \hyperlink{class_b_m_a_t_c_p_socket}{B\+M\+A\+T\+C\+P\+Socket} object.


\begin{DoxyParams}{Parameters}
{\em e\+Poll} & the \hyperlink{class_b_m_a_e_poll}{B\+M\+A\+E\+Poll} instance that manages the socket. \\
\hline
{\em url} & the IP address for the socket to receive connection requests. \\
\hline
{\em port} & the port number that the socket will listen on. \\
\hline
{\em command\+Name} & the name of the command used to invoke the status display for this object. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the instance of the \hyperlink{class_b_m_a_t_c_p_server_socket}{B\+M\+A\+T\+C\+P\+Server\+Socket}. 
\end{DoxyReturn}
\mbox{\Hypertarget{class_b_m_a_t_c_p_server_socket_a32383b879e9464c955adab2c7bb33fc2}\label{class_b_m_a_t_c_p_server_socket_a32383b879e9464c955adab2c7bb33fc2}} 
\index{B\+M\+A\+T\+C\+P\+Server\+Socket@{B\+M\+A\+T\+C\+P\+Server\+Socket}!````~B\+M\+A\+T\+C\+P\+Server\+Socket@{$\sim$\+B\+M\+A\+T\+C\+P\+Server\+Socket}}
\index{````~B\+M\+A\+T\+C\+P\+Server\+Socket@{$\sim$\+B\+M\+A\+T\+C\+P\+Server\+Socket}!B\+M\+A\+T\+C\+P\+Server\+Socket@{B\+M\+A\+T\+C\+P\+Server\+Socket}}
\subsubsection{\texorpdfstring{$\sim$\+B\+M\+A\+T\+C\+P\+Server\+Socket()}{~BMATCPServerSocket()}}
{\footnotesize\ttfamily B\+M\+A\+T\+C\+P\+Server\+Socket\+::$\sim$\+B\+M\+A\+T\+C\+P\+Server\+Socket (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

The destructor for this object. 

\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_b_m_a_t_c_p_server_socket_a5eb805883d7a496be0a1cbc81c09c145}\label{class_b_m_a_t_c_p_server_socket_a5eb805883d7a496be0a1cbc81c09c145}} 
\index{B\+M\+A\+T\+C\+P\+Server\+Socket@{B\+M\+A\+T\+C\+P\+Server\+Socket}!get\+Socket\+Accept@{get\+Socket\+Accept}}
\index{get\+Socket\+Accept@{get\+Socket\+Accept}!B\+M\+A\+T\+C\+P\+Server\+Socket@{B\+M\+A\+T\+C\+P\+Server\+Socket}}
\subsubsection{\texorpdfstring{get\+Socket\+Accept()}{getSocketAccept()}}
{\footnotesize\ttfamily virtual \hyperlink{class_b_m_a_session}{B\+M\+A\+Session}$\ast$ B\+M\+A\+T\+C\+P\+Server\+Socket\+::get\+Socket\+Accept (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [protected]}, {\ttfamily [pure virtual]}}

get\+Socket\+Accept is designed to allow a polymorphic extension of this object to return a type of object that extends the definition of the server socket. Returning the appropriate session object that extends from \hyperlink{class_b_m_a_session}{B\+M\+A\+Session} provides the mechanism where the server can select the protocol dialog for the desired service. 

Implemented in \hyperlink{class_b_m_a_t_l_s_server_socket_afc1575a34ddd6e40619874b7364fbceb}{B\+M\+A\+T\+L\+S\+Server\+Socket}, and \hyperlink{class_b_m_a_console_server_a94847bdd07f651825e5fce5237e98335}{B\+M\+A\+Console\+Server}.

\mbox{\Hypertarget{class_b_m_a_t_c_p_server_socket_ae562db0627e31f558189a4140a9d0a36}\label{class_b_m_a_t_c_p_server_socket_ae562db0627e31f558189a4140a9d0a36}} 
\index{B\+M\+A\+T\+C\+P\+Server\+Socket@{B\+M\+A\+T\+C\+P\+Server\+Socket}!on\+Data\+Received@{on\+Data\+Received}}
\index{on\+Data\+Received@{on\+Data\+Received}!B\+M\+A\+T\+C\+P\+Server\+Socket@{B\+M\+A\+T\+C\+P\+Server\+Socket}}
\subsubsection{\texorpdfstring{on\+Data\+Received()}{onDataReceived()}}
{\footnotesize\ttfamily void B\+M\+A\+T\+C\+P\+Server\+Socket\+::on\+Data\+Received (\begin{DoxyParamCaption}\item[{std\+::string}]{data }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [protected]}, {\ttfamily [virtual]}}

Override the virtual data\+Received since for the server these are requests to accept the new connection socket. No data is to be read or written when this method is called. It is the response to the fact that a new connection is coming into the system


\begin{DoxyParams}{Parameters}
{\em data} & the pointer to the buffer containing the received data. \\
\hline
{\em length} & the length of the associated data buffer. \\
\hline
\end{DoxyParams}


Implements \hyperlink{class_b_m_a_socket_ad77bf590a4d9807bd8f0a81667903f2e}{B\+M\+A\+Socket}.

\mbox{\Hypertarget{class_b_m_a_t_c_p_server_socket_afb337fa6ec678ce45b1c58ca8a20768a}\label{class_b_m_a_t_c_p_server_socket_afb337fa6ec678ce45b1c58ca8a20768a}} 
\index{B\+M\+A\+T\+C\+P\+Server\+Socket@{B\+M\+A\+T\+C\+P\+Server\+Socket}!process\+Command@{process\+Command}}
\index{process\+Command@{process\+Command}!B\+M\+A\+T\+C\+P\+Server\+Socket@{B\+M\+A\+T\+C\+P\+Server\+Socket}}
\subsubsection{\texorpdfstring{process\+Command()}{processCommand()}}
{\footnotesize\ttfamily void B\+M\+A\+T\+C\+P\+Server\+Socket\+::process\+Command (\begin{DoxyParamCaption}\item[{std\+::string}]{command,  }\item[{\hyperlink{class_b_m_a_session}{B\+M\+A\+Session} $\ast$}]{session }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [protected]}, {\ttfamily [virtual]}}

This method is called when the \hyperlink{class_b_m_a_command}{B\+M\+A\+Command} associated with this object is requested because a user has typed in the associated command name on a command entry line.


\begin{DoxyParams}{Parameters}
{\em the} & session object to write the output to. \\
\hline
\end{DoxyParams}


Implements \hyperlink{class_b_m_a_command}{B\+M\+A\+Command}.



\subsection{Member Data Documentation}
\mbox{\Hypertarget{class_b_m_a_t_c_p_server_socket_a8719aeb1b87b9f0d7e0b38aa28ab9a35}\label{class_b_m_a_t_c_p_server_socket_a8719aeb1b87b9f0d7e0b38aa28ab9a35}} 
\index{B\+M\+A\+T\+C\+P\+Server\+Socket@{B\+M\+A\+T\+C\+P\+Server\+Socket}!sessions@{sessions}}
\index{sessions@{sessions}!B\+M\+A\+T\+C\+P\+Server\+Socket@{B\+M\+A\+T\+C\+P\+Server\+Socket}}
\subsubsection{\texorpdfstring{sessions}{sessions}}
{\footnotesize\ttfamily std\+::vector$<$\hyperlink{class_b_m_a_session}{B\+M\+A\+Session} $\ast$$>$ B\+M\+A\+T\+C\+P\+Server\+Socket\+::sessions}

The list of sessions that are currently open and being maintained by this object. 

The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
/home/barant/\+Development/\+B\+M\+A/server\+\_\+core/\+Server\+Core/B\+M\+A\+T\+C\+P\+Server\+Socket.\+h\item 
/home/barant/\+Development/\+B\+M\+A/server\+\_\+core/\+Server\+Core/B\+M\+A\+T\+C\+P\+Server\+Socket.\+cpp\end{DoxyCompactItemize}
