\hypertarget{lo__serverthread_8h}{\section{lo\+\_\+serverthread.\+h File Reference}
\label{lo__serverthread_8h}\index{lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}}
}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread} \hyperlink{lo__serverthread_8h_abe3e0c31189adfd7624de6c507b610ba}{lo\+\_\+server\+\_\+thread\+\_\+new} (const char $\ast$port, \hyperlink{lo__types_8h_aa5d2e4aa0ff9d4459fcc76e7ed5839fc}{lo\+\_\+err\+\_\+handler} err\+\_\+h)
\begin{DoxyCompactList}\small\item\em Create a new server thread to handle incoming O\+S\+C messages. \end{DoxyCompactList}\item 
\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread} \hyperlink{lo__serverthread_8h_a0fa9fcae4eabe09847d46b134dc33aa4}{lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+multicast} (const char $\ast$group, const char $\ast$port, \hyperlink{lo__types_8h_aa5d2e4aa0ff9d4459fcc76e7ed5839fc}{lo\+\_\+err\+\_\+handler} err\+\_\+h)
\begin{DoxyCompactList}\small\item\em Create a new server thread to handle incoming O\+S\+C messages, and join a U\+D\+P multicast group. \end{DoxyCompactList}\item 
\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread} \hyperlink{lo__serverthread_8h_a6713cedfb0b2c4f066ec8a19366bf095}{lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+with\+\_\+proto} (const char $\ast$port, int proto, \hyperlink{lo__types_8h_aa5d2e4aa0ff9d4459fcc76e7ed5839fc}{lo\+\_\+err\+\_\+handler} err\+\_\+h)
\begin{DoxyCompactList}\small\item\em Create a new server thread to handle incoming O\+S\+C messages, specifying protocol. \end{DoxyCompactList}\item 
\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread} \hyperlink{lo__serverthread_8h_aac49abadaaac33408eae4060bb44b9a2}{lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+from\+\_\+url} (const char $\ast$url, \hyperlink{lo__types_8h_aa5d2e4aa0ff9d4459fcc76e7ed5839fc}{lo\+\_\+err\+\_\+handler} err\+\_\+h)
\begin{DoxyCompactList}\small\item\em Create a new server thread, taking port and the optional multicast group I\+P from an U\+R\+L string. \end{DoxyCompactList}\item 
void \hyperlink{lo__serverthread_8h_ad72be3f2a81b9583ad69dd007080c0e5}{lo\+\_\+server\+\_\+thread\+\_\+free} (\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread} st)
\begin{DoxyCompactList}\small\item\em Free memory taken by a server thread. \end{DoxyCompactList}\item 
\hyperlink{lo__types_8h_a66faedf5da13231d8c0166870477dce5}{lo\+\_\+method} \hyperlink{lo__serverthread_8h_acff9c90a8efc400448276b2d20831010}{lo\+\_\+server\+\_\+thread\+\_\+add\+\_\+method} (\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread} st, const char $\ast$path, const char $\ast$typespec, \hyperlink{lo__types_8h_a3b1c86c0925d05e13b5438ce8fe80a6c}{lo\+\_\+method\+\_\+handler} h, void $\ast$user\+\_\+data)
\begin{DoxyCompactList}\small\item\em Add an O\+S\+C method to the specifed server thread. \end{DoxyCompactList}\item 
void \hyperlink{lo__serverthread_8h_a072edf53338bc807444c4b510643a828}{lo\+\_\+server\+\_\+thread\+\_\+del\+\_\+method} (\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread} st, const char $\ast$path, const char $\ast$typespec)
\begin{DoxyCompactList}\small\item\em Delete an O\+S\+C method from the specifed server thread. \end{DoxyCompactList}\item 
int \hyperlink{lo__serverthread_8h_a4b284c1b96d0354c5de4ff7ba5a44fbc}{lo\+\_\+server\+\_\+thread\+\_\+start} (\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread} st)
\begin{DoxyCompactList}\small\item\em Start the server thread. \end{DoxyCompactList}\item 
int \hyperlink{lo__serverthread_8h_a06992ac46b04e58cb77d7c519a578f57}{lo\+\_\+server\+\_\+thread\+\_\+stop} (\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread} st)
\begin{DoxyCompactList}\small\item\em Stop the server thread. \end{DoxyCompactList}\item 
int \hyperlink{lo__serverthread_8h_a22f4b18eeac41490647ab9fe2333f933}{lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+port} (\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread} st)
\begin{DoxyCompactList}\small\item\em Return the port number that the server thread has bound to. \end{DoxyCompactList}\item 
char $\ast$ \hyperlink{lo__serverthread_8h_ac2805a7cbdd9465be4ca5101c569faf0}{lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+url} (\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread} st)
\begin{DoxyCompactList}\small\item\em Return a U\+R\+L describing the address of the server thread. \end{DoxyCompactList}\item 
\hyperlink{lo__types_8h_a59067bf50cf8abb4371da6f03c9036c9}{lo\+\_\+server} \hyperlink{lo__serverthread_8h_ab968d51fa6e0d4bea92e3f84f5556161}{lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+server} (\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread} st)
\begin{DoxyCompactList}\small\item\em Return the lo\+\_\+server for a lo\+\_\+server\+\_\+thread. \end{DoxyCompactList}\item 
int \hyperlink{lo__serverthread_8h_a7bc3d8361b65e3ad112a1da956d9114e}{lo\+\_\+server\+\_\+thread\+\_\+events\+\_\+pending} (\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread} st)
\begin{DoxyCompactList}\small\item\em Return true if there are scheduled events (eg. from bundles) waiting to be dispatched by the thread. \end{DoxyCompactList}\item 
void \hyperlink{lo__serverthread_8h_a6ba794aacbb04dada6939980ce71381a}{lo\+\_\+server\+\_\+thread\+\_\+pp} (\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread} st)
\begin{DoxyCompactList}\small\item\em Pretty-\/print a lo\+\_\+server\+\_\+thread object. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
The liblo headerfile declaring thread-\/related functions. 

\subsection{Function Documentation}
\hypertarget{lo__serverthread_8h_acff9c90a8efc400448276b2d20831010}{\index{lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}!lo\+\_\+server\+\_\+thread\+\_\+add\+\_\+method@{lo\+\_\+server\+\_\+thread\+\_\+add\+\_\+method}}
\index{lo\+\_\+server\+\_\+thread\+\_\+add\+\_\+method@{lo\+\_\+server\+\_\+thread\+\_\+add\+\_\+method}!lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}}
\subsubsection[{lo\+\_\+server\+\_\+thread\+\_\+add\+\_\+method}]{\setlength{\rightskip}{0pt plus 5cm}{\bf lo\+\_\+method} lo\+\_\+server\+\_\+thread\+\_\+add\+\_\+method (
\begin{DoxyParamCaption}
\item[{{\bf lo\+\_\+server\+\_\+thread}}]{st, }
\item[{const char $\ast$}]{path, }
\item[{const char $\ast$}]{typespec, }
\item[{{\bf lo\+\_\+method\+\_\+handler}}]{h, }
\item[{void $\ast$}]{user\+\_\+data}
\end{DoxyParamCaption}
)}}\label{lo__serverthread_8h_acff9c90a8efc400448276b2d20831010}


Add an O\+S\+C method to the specifed server thread. 


\begin{DoxyParams}{Parameters}
{\em st} & The server thread the method is to be added to. \\
\hline
{\em path} & The O\+S\+C path to register the method to. If N\+U\+L\+L is passed the method will match all paths. \\
\hline
{\em typespec} & The typespec the method accepts. Incoming messages with similar typespecs (e.\+g. ones with numerical types in the same position) will be coerced to the typespec given here. \\
\hline
{\em h} & The method handler callback function that will be called it a matching message is received \\
\hline
{\em user\+\_\+data} & A value that will be passed to the callback function, h, when its invoked matching from this method. \\
\hline
\end{DoxyParams}
\hypertarget{lo__serverthread_8h_a072edf53338bc807444c4b510643a828}{\index{lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}!lo\+\_\+server\+\_\+thread\+\_\+del\+\_\+method@{lo\+\_\+server\+\_\+thread\+\_\+del\+\_\+method}}
\index{lo\+\_\+server\+\_\+thread\+\_\+del\+\_\+method@{lo\+\_\+server\+\_\+thread\+\_\+del\+\_\+method}!lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}}
\subsubsection[{lo\+\_\+server\+\_\+thread\+\_\+del\+\_\+method}]{\setlength{\rightskip}{0pt plus 5cm}void lo\+\_\+server\+\_\+thread\+\_\+del\+\_\+method (
\begin{DoxyParamCaption}
\item[{{\bf lo\+\_\+server\+\_\+thread}}]{st, }
\item[{const char $\ast$}]{path, }
\item[{const char $\ast$}]{typespec}
\end{DoxyParamCaption}
)}}\label{lo__serverthread_8h_a072edf53338bc807444c4b510643a828}


Delete an O\+S\+C method from the specifed server thread. 


\begin{DoxyParams}{Parameters}
{\em st} & The server thread the method is to be removed from. \\
\hline
{\em path} & The O\+S\+C path of the method to delete. If N\+U\+L\+L is passed the method will match the generic handler. \\
\hline
{\em typespec} & The typespec the method accepts. \\
\hline
\end{DoxyParams}
\hypertarget{lo__serverthread_8h_a7bc3d8361b65e3ad112a1da956d9114e}{\index{lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}!lo\+\_\+server\+\_\+thread\+\_\+events\+\_\+pending@{lo\+\_\+server\+\_\+thread\+\_\+events\+\_\+pending}}
\index{lo\+\_\+server\+\_\+thread\+\_\+events\+\_\+pending@{lo\+\_\+server\+\_\+thread\+\_\+events\+\_\+pending}!lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}}
\subsubsection[{lo\+\_\+server\+\_\+thread\+\_\+events\+\_\+pending}]{\setlength{\rightskip}{0pt plus 5cm}int lo\+\_\+server\+\_\+thread\+\_\+events\+\_\+pending (
\begin{DoxyParamCaption}
\item[{{\bf lo\+\_\+server\+\_\+thread}}]{st}
\end{DoxyParamCaption}
)}}\label{lo__serverthread_8h_a7bc3d8361b65e3ad112a1da956d9114e}


Return true if there are scheduled events (eg. from bundles) waiting to be dispatched by the thread. 

\hypertarget{lo__serverthread_8h_ad72be3f2a81b9583ad69dd007080c0e5}{\index{lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}!lo\+\_\+server\+\_\+thread\+\_\+free@{lo\+\_\+server\+\_\+thread\+\_\+free}}
\index{lo\+\_\+server\+\_\+thread\+\_\+free@{lo\+\_\+server\+\_\+thread\+\_\+free}!lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}}
\subsubsection[{lo\+\_\+server\+\_\+thread\+\_\+free}]{\setlength{\rightskip}{0pt plus 5cm}void lo\+\_\+server\+\_\+thread\+\_\+free (
\begin{DoxyParamCaption}
\item[{{\bf lo\+\_\+server\+\_\+thread}}]{st}
\end{DoxyParamCaption}
)}}\label{lo__serverthread_8h_ad72be3f2a81b9583ad69dd007080c0e5}


Free memory taken by a server thread. 

Frees the memory, and, if currently running will stop the associated thread. \hypertarget{lo__serverthread_8h_a22f4b18eeac41490647ab9fe2333f933}{\index{lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}!lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+port@{lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+port}}
\index{lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+port@{lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+port}!lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}}
\subsubsection[{lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+port}]{\setlength{\rightskip}{0pt plus 5cm}int lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+port (
\begin{DoxyParamCaption}
\item[{{\bf lo\+\_\+server\+\_\+thread}}]{st}
\end{DoxyParamCaption}
)}}\label{lo__serverthread_8h_a22f4b18eeac41490647ab9fe2333f933}


Return the port number that the server thread has bound to. 

\hypertarget{lo__serverthread_8h_ab968d51fa6e0d4bea92e3f84f5556161}{\index{lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}!lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+server@{lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+server}}
\index{lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+server@{lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+server}!lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}}
\subsubsection[{lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+server}]{\setlength{\rightskip}{0pt plus 5cm}{\bf lo\+\_\+server} lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+server (
\begin{DoxyParamCaption}
\item[{{\bf lo\+\_\+server\+\_\+thread}}]{st}
\end{DoxyParamCaption}
)}}\label{lo__serverthread_8h_ab968d51fa6e0d4bea92e3f84f5556161}


Return the lo\+\_\+server for a lo\+\_\+server\+\_\+thread. 

This function is useful for passing a thread's lo\+\_\+server to \hyperlink{group__liblo_gaa4a314562b09e2fd00749a5d0b4d0955}{lo\+\_\+send\+\_\+from()}. \hypertarget{lo__serverthread_8h_ac2805a7cbdd9465be4ca5101c569faf0}{\index{lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}!lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+url@{lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+url}}
\index{lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+url@{lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+url}!lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}}
\subsubsection[{lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+url}]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+url (
\begin{DoxyParamCaption}
\item[{{\bf lo\+\_\+server\+\_\+thread}}]{st}
\end{DoxyParamCaption}
)}}\label{lo__serverthread_8h_ac2805a7cbdd9465be4ca5101c569faf0}


Return a U\+R\+L describing the address of the server thread. 

Return value must be free()'d to reclaim memory. \hypertarget{lo__serverthread_8h_abe3e0c31189adfd7624de6c507b610ba}{\index{lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}!lo\+\_\+server\+\_\+thread\+\_\+new@{lo\+\_\+server\+\_\+thread\+\_\+new}}
\index{lo\+\_\+server\+\_\+thread\+\_\+new@{lo\+\_\+server\+\_\+thread\+\_\+new}!lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}}
\subsubsection[{lo\+\_\+server\+\_\+thread\+\_\+new}]{\setlength{\rightskip}{0pt plus 5cm}{\bf lo\+\_\+server\+\_\+thread} lo\+\_\+server\+\_\+thread\+\_\+new (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{port, }
\item[{{\bf lo\+\_\+err\+\_\+handler}}]{err\+\_\+h}
\end{DoxyParamCaption}
)}}\label{lo__serverthread_8h_abe3e0c31189adfd7624de6c507b610ba}


Create a new server thread to handle incoming O\+S\+C messages. 

Server threads take care of the message reception and dispatch by transparently creating a system thread to handle incoming messages. Use this if you do not want to handle the threading yourself.


\begin{DoxyParams}{Parameters}
{\em port} & If N\+U\+L\+L is passed then an unused port will be chosen by the system, its number may be retrieved with \hyperlink{lo__serverthread_8h_a22f4b18eeac41490647ab9fe2333f933}{lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+port()} so it can be passed to clients. Otherwise a decimal port number, service name or U\+N\+I\+X domain socket path may be passed. \\
\hline
{\em err\+\_\+h} & A function that will be called in the event of an error being raised. The function prototype is defined in \hyperlink{lo__types_8h}{lo\+\_\+types.\+h} \\
\hline
\end{DoxyParams}
\hypertarget{lo__serverthread_8h_aac49abadaaac33408eae4060bb44b9a2}{\index{lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}!lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+from\+\_\+url@{lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+from\+\_\+url}}
\index{lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+from\+\_\+url@{lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+from\+\_\+url}!lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}}
\subsubsection[{lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+from\+\_\+url}]{\setlength{\rightskip}{0pt plus 5cm}{\bf lo\+\_\+server\+\_\+thread} lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+from\+\_\+url (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{url, }
\item[{{\bf lo\+\_\+err\+\_\+handler}}]{err\+\_\+h}
\end{DoxyParamCaption}
)}}\label{lo__serverthread_8h_aac49abadaaac33408eae4060bb44b9a2}


Create a new server thread, taking port and the optional multicast group I\+P from an U\+R\+L string. 


\begin{DoxyParams}{Parameters}
{\em url} & The U\+R\+L to specify the server parameters. \\
\hline
{\em err\+\_\+h} & An error callback function that will be called if there is an error in messge reception or server creation. Pass N\+U\+L\+L if you do not want error handling. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A new lo\+\_\+server\+\_\+thread instance. 
\end{DoxyReturn}
\hypertarget{lo__serverthread_8h_a0fa9fcae4eabe09847d46b134dc33aa4}{\index{lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}!lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+multicast@{lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+multicast}}
\index{lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+multicast@{lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+multicast}!lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}}
\subsubsection[{lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+multicast}]{\setlength{\rightskip}{0pt plus 5cm}{\bf lo\+\_\+server\+\_\+thread} lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+multicast (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{group, }
\item[{const char $\ast$}]{port, }
\item[{{\bf lo\+\_\+err\+\_\+handler}}]{err\+\_\+h}
\end{DoxyParamCaption}
)}}\label{lo__serverthread_8h_a0fa9fcae4eabe09847d46b134dc33aa4}


Create a new server thread to handle incoming O\+S\+C messages, and join a U\+D\+P multicast group. 

Server threads take care of the message reception and dispatch by transparently creating a system thread to handle incoming messages. Use this if you do not want to handle the threading yourself.


\begin{DoxyParams}{Parameters}
{\em group} & The multicast group to join. See documentation on I\+P multicast for the acceptable address range; e.\+g., \href{http://tldp.org/HOWTO/Multicast-HOWTO-2.html}{\tt http\+://tldp.\+org/\+H\+O\+W\+T\+O/\+Multicast-\/\+H\+O\+W\+T\+O-\/2.\+html} \\
\hline
{\em port} & If N\+U\+L\+L is passed then an unused port will be chosen by the system, its number may be retrieved with \hyperlink{lo__serverthread_8h_a22f4b18eeac41490647ab9fe2333f933}{lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+port()} so it can be passed to clients. Otherwise a decimal port number, service name or U\+N\+I\+X domain socket path may be passed. \\
\hline
{\em err\+\_\+h} & A function that will be called in the event of an error being raised. The function prototype is defined in \hyperlink{lo__types_8h}{lo\+\_\+types.\+h} \\
\hline
\end{DoxyParams}
\hypertarget{lo__serverthread_8h_a6713cedfb0b2c4f066ec8a19366bf095}{\index{lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}!lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+with\+\_\+proto@{lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+with\+\_\+proto}}
\index{lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+with\+\_\+proto@{lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+with\+\_\+proto}!lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}}
\subsubsection[{lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+with\+\_\+proto}]{\setlength{\rightskip}{0pt plus 5cm}{\bf lo\+\_\+server\+\_\+thread} lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+with\+\_\+proto (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{port, }
\item[{int}]{proto, }
\item[{{\bf lo\+\_\+err\+\_\+handler}}]{err\+\_\+h}
\end{DoxyParamCaption}
)}}\label{lo__serverthread_8h_a6713cedfb0b2c4f066ec8a19366bf095}


Create a new server thread to handle incoming O\+S\+C messages, specifying protocol. 

Server threads take care of the message reception and dispatch by transparently creating a system thread to handle incoming messages. Use this if you do not want to handle the threading yourself.


\begin{DoxyParams}{Parameters}
{\em port} & If N\+U\+L\+L is passed then an unused port will be chosen by the system, its number may be retrieved with \hyperlink{lo__serverthread_8h_a22f4b18eeac41490647ab9fe2333f933}{lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+port()} so it can be passed to clients. Otherwise a decimal port number, service name or U\+N\+I\+X domain socket path may be passed. \\
\hline
{\em proto} & The protocol to use, should be one of L\+O\+\_\+\+U\+D\+P, L\+O\+\_\+\+T\+C\+P or L\+O\+\_\+\+U\+N\+I\+X. \\
\hline
{\em err\+\_\+h} & A function that will be called in the event of an error being raised. The function prototype is defined in \hyperlink{lo__types_8h}{lo\+\_\+types.\+h} \\
\hline
\end{DoxyParams}
\hypertarget{lo__serverthread_8h_a6ba794aacbb04dada6939980ce71381a}{\index{lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}!lo\+\_\+server\+\_\+thread\+\_\+pp@{lo\+\_\+server\+\_\+thread\+\_\+pp}}
\index{lo\+\_\+server\+\_\+thread\+\_\+pp@{lo\+\_\+server\+\_\+thread\+\_\+pp}!lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}}
\subsubsection[{lo\+\_\+server\+\_\+thread\+\_\+pp}]{\setlength{\rightskip}{0pt plus 5cm}void lo\+\_\+server\+\_\+thread\+\_\+pp (
\begin{DoxyParamCaption}
\item[{{\bf lo\+\_\+server\+\_\+thread}}]{st}
\end{DoxyParamCaption}
)}}\label{lo__serverthread_8h_a6ba794aacbb04dada6939980ce71381a}


Pretty-\/print a lo\+\_\+server\+\_\+thread object. 

\hypertarget{lo__serverthread_8h_a4b284c1b96d0354c5de4ff7ba5a44fbc}{\index{lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}!lo\+\_\+server\+\_\+thread\+\_\+start@{lo\+\_\+server\+\_\+thread\+\_\+start}}
\index{lo\+\_\+server\+\_\+thread\+\_\+start@{lo\+\_\+server\+\_\+thread\+\_\+start}!lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}}
\subsubsection[{lo\+\_\+server\+\_\+thread\+\_\+start}]{\setlength{\rightskip}{0pt plus 5cm}int lo\+\_\+server\+\_\+thread\+\_\+start (
\begin{DoxyParamCaption}
\item[{{\bf lo\+\_\+server\+\_\+thread}}]{st}
\end{DoxyParamCaption}
)}}\label{lo__serverthread_8h_a4b284c1b96d0354c5de4ff7ba5a44fbc}


Start the server thread. 


\begin{DoxyParams}{Parameters}
{\em st} & the server thread to start. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Less than 0 on failure, 0 on success. 
\end{DoxyReturn}
\hypertarget{lo__serverthread_8h_a06992ac46b04e58cb77d7c519a578f57}{\index{lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}!lo\+\_\+server\+\_\+thread\+\_\+stop@{lo\+\_\+server\+\_\+thread\+\_\+stop}}
\index{lo\+\_\+server\+\_\+thread\+\_\+stop@{lo\+\_\+server\+\_\+thread\+\_\+stop}!lo\+\_\+serverthread.\+h@{lo\+\_\+serverthread.\+h}}
\subsubsection[{lo\+\_\+server\+\_\+thread\+\_\+stop}]{\setlength{\rightskip}{0pt plus 5cm}int lo\+\_\+server\+\_\+thread\+\_\+stop (
\begin{DoxyParamCaption}
\item[{{\bf lo\+\_\+server\+\_\+thread}}]{st}
\end{DoxyParamCaption}
)}}\label{lo__serverthread_8h_a06992ac46b04e58cb77d7c519a578f57}


Stop the server thread. 


\begin{DoxyParams}{Parameters}
{\em st} & the server thread to start. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Less than 0 on failure, 0 on success. 
\end{DoxyReturn}
