\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 
\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}} \mbox{\hyperlink{lo__serverthread_8h_abe3e0c31189adfd7624de6c507b610ba}{lo\+\_\+server\+\_\+thread\+\_\+new}} (const char $\ast$port, \mbox{\hyperlink{lo__types_8h_aa4406d5e90db364c02337656e6c95250}{lo\+\_\+err\+\_\+handler}} err\+\_\+h)
\begin{DoxyCompactList}\small\item\em Create a new server thread to handle incoming O\+SC messages. \end{DoxyCompactList}\item 
\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}} \mbox{\hyperlink{lo__serverthread_8h_a0fa9fcae4eabe09847d46b134dc33aa4}{lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+multicast}} (const char $\ast$group, const char $\ast$port, \mbox{\hyperlink{lo__types_8h_aa4406d5e90db364c02337656e6c95250}{lo\+\_\+err\+\_\+handler}} err\+\_\+h)
\begin{DoxyCompactList}\small\item\em Create a new server thread to handle incoming O\+SC messages, and join a U\+DP multicast group. \end{DoxyCompactList}\item 
\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}} \mbox{\hyperlink{lo__serverthread_8h_ad6d57101bbdaa6571ed76373b2c3a50a}{lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+multicast\+\_\+iface}} (const char $\ast$group, const char $\ast$port, const char $\ast$iface, const char $\ast$ip, \mbox{\hyperlink{lo__types_8h_aa4406d5e90db364c02337656e6c95250}{lo\+\_\+err\+\_\+handler}} err\+\_\+h)
\begin{DoxyCompactList}\small\item\em Create a new server thread instance, and join a U\+DP multicast group, optionally specifying which network interface to use. Note that usually only one of iface or ip are specified. \end{DoxyCompactList}\item 
\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}} \mbox{\hyperlink{lo__serverthread_8h_a6713cedfb0b2c4f066ec8a19366bf095}{lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+with\+\_\+proto}} (const char $\ast$port, int proto, \mbox{\hyperlink{lo__types_8h_aa4406d5e90db364c02337656e6c95250}{lo\+\_\+err\+\_\+handler}} err\+\_\+h)
\begin{DoxyCompactList}\small\item\em Create a new server thread to handle incoming O\+SC messages, specifying protocol. \end{DoxyCompactList}\item 
\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}} \mbox{\hyperlink{lo__serverthread_8h_aac49abadaaac33408eae4060bb44b9a2}{lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+from\+\_\+url}} (const char $\ast$url, \mbox{\hyperlink{lo__types_8h_aa4406d5e90db364c02337656e6c95250}{lo\+\_\+err\+\_\+handler}} err\+\_\+h)
\begin{DoxyCompactList}\small\item\em Create a new server thread, taking port and the optional multicast group IP from an U\+RL string. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{lo__serverthread_8h_ad72be3f2a81b9583ad69dd007080c0e5}{lo\+\_\+server\+\_\+thread\+\_\+free}} (\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}} st)
\begin{DoxyCompactList}\small\item\em Free memory taken by a server thread. \end{DoxyCompactList}\item 
\mbox{\hyperlink{lo__types_8h_a66faedf5da13231d8c0166870477dce5}{lo\+\_\+method}} \mbox{\hyperlink{lo__serverthread_8h_af500729c76fd5bb4798d350b6307adc1}{lo\+\_\+server\+\_\+thread\+\_\+add\+\_\+method}} (\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}} st, const char $\ast$path, const char $\ast$typespec, \mbox{\hyperlink{lo__types_8h_a5b38e0822e47acaa3c7267348f50f66c}{lo\+\_\+method\+\_\+handler}} h, const void $\ast$user\+\_\+data)
\begin{DoxyCompactList}\small\item\em Add an O\+SC method to the specifed server thread. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{lo__serverthread_8h_a072edf53338bc807444c4b510643a828}{lo\+\_\+server\+\_\+thread\+\_\+del\+\_\+method}} (\mbox{\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\+SC method from the specifed server thread. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{lo__serverthread_8h_a28733dd7fc8e8df6969674779d74fddd}{lo\+\_\+server\+\_\+thread\+\_\+del\+\_\+lo\+\_\+method}} (\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}} st, \mbox{\hyperlink{lo__types_8h_a66faedf5da13231d8c0166870477dce5}{lo\+\_\+method}} m)
\begin{DoxyCompactList}\small\item\em Delete an O\+SC method from the specified server thread. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{lo__serverthread_8h_ab4d5248ecc0d55e46c0f025e727ceb52}{lo\+\_\+server\+\_\+thread\+\_\+set\+\_\+callbacks}} (\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}} st, \mbox{\hyperlink{lo__types_8h_aed5d674714d659d776d848d716d9efbc}{lo\+\_\+server\+\_\+thread\+\_\+init\+\_\+callback}} init, \mbox{\hyperlink{lo__types_8h_a2be941151f7a8ae193ba1687b41b2dc4}{lo\+\_\+server\+\_\+thread\+\_\+cleanup\+\_\+callback}} cleanup, void $\ast$user\+\_\+data)
\begin{DoxyCompactList}\small\item\em Set an init and/or a cleanup function to the specifed server thread. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{lo__serverthread_8h_a4b284c1b96d0354c5de4ff7ba5a44fbc}{lo\+\_\+server\+\_\+thread\+\_\+start}} (\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}} st)
\begin{DoxyCompactList}\small\item\em Start the server thread. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{lo__serverthread_8h_a06992ac46b04e58cb77d7c519a578f57}{lo\+\_\+server\+\_\+thread\+\_\+stop}} (\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}} st)
\begin{DoxyCompactList}\small\item\em Stop the server thread. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{lo__serverthread_8h_a22f4b18eeac41490647ab9fe2333f933}{lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+port}} (\mbox{\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$ \mbox{\hyperlink{lo__serverthread_8h_ac2805a7cbdd9465be4ca5101c569faf0}{lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+url}} (\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}} st)
\begin{DoxyCompactList}\small\item\em Return a U\+RL describing the address of the server thread. \end{DoxyCompactList}\item 
\mbox{\hyperlink{lo__types_8h_a59067bf50cf8abb4371da6f03c9036c9}{lo\+\_\+server}} \mbox{\hyperlink{lo__serverthread_8h_ab968d51fa6e0d4bea92e3f84f5556161}{lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+server}} (\mbox{\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 \mbox{\hyperlink{lo__serverthread_8h_a7bc3d8361b65e3ad112a1da956d9114e}{lo\+\_\+server\+\_\+thread\+\_\+events\+\_\+pending}} (\mbox{\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 \mbox{\hyperlink{lo__serverthread_8h_a6ba794aacbb04dada6939980ce71381a}{lo\+\_\+server\+\_\+thread\+\_\+pp}} (\mbox{\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}
\mbox{\Hypertarget{lo__serverthread_8h_af500729c76fd5bb4798d350b6307adc1}\label{lo__serverthread_8h_af500729c76fd5bb4798d350b6307adc1}} 
\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{\texorpdfstring{lo\_server\_thread\_add\_method()}{lo\_server\_thread\_add\_method()}}
{\footnotesize\ttfamily \mbox{\hyperlink{lo__types_8h_a66faedf5da13231d8c0166870477dce5}{lo\+\_\+method}} lo\+\_\+server\+\_\+thread\+\_\+add\+\_\+method (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}}}]{st,  }\item[{const char $\ast$}]{path,  }\item[{const char $\ast$}]{typespec,  }\item[{\mbox{\hyperlink{lo__types_8h_a5b38e0822e47acaa3c7267348f50f66c}{lo\+\_\+method\+\_\+handler}}}]{h,  }\item[{const void $\ast$}]{user\+\_\+data }\end{DoxyParamCaption})}



Add an O\+SC 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\+SC path to register the method to. If N\+U\+LL 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}
\mbox{\Hypertarget{lo__serverthread_8h_a28733dd7fc8e8df6969674779d74fddd}\label{lo__serverthread_8h_a28733dd7fc8e8df6969674779d74fddd}} 
\index{lo\_serverthread.h@{lo\_serverthread.h}!lo\_server\_thread\_del\_lo\_method@{lo\_server\_thread\_del\_lo\_method}}
\index{lo\_server\_thread\_del\_lo\_method@{lo\_server\_thread\_del\_lo\_method}!lo\_serverthread.h@{lo\_serverthread.h}}
\subsubsection{\texorpdfstring{lo\_server\_thread\_del\_lo\_method()}{lo\_server\_thread\_del\_lo\_method()}}
{\footnotesize\ttfamily int lo\+\_\+server\+\_\+thread\+\_\+del\+\_\+lo\+\_\+method (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}}}]{st,  }\item[{\mbox{\hyperlink{lo__types_8h_a66faedf5da13231d8c0166870477dce5}{lo\+\_\+method}}}]{m }\end{DoxyParamCaption})}



Delete an O\+SC method from the specified server thread. 


\begin{DoxyParams}{Parameters}
{\em s} & The server thread the method is to be removed from. \\
\hline
{\em m} & The lo\+\_\+method identifier returned from lo\+\_\+server\+\_\+add\+\_\+method for the method to delete from the server. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Non-\/zero if it was not found in the list of methods for the server. 
\end{DoxyReturn}
\mbox{\Hypertarget{lo__serverthread_8h_a072edf53338bc807444c4b510643a828}\label{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{\texorpdfstring{lo\_server\_thread\_del\_method()}{lo\_server\_thread\_del\_method()}}
{\footnotesize\ttfamily void lo\+\_\+server\+\_\+thread\+\_\+del\+\_\+method (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}}}]{st,  }\item[{const char $\ast$}]{path,  }\item[{const char $\ast$}]{typespec }\end{DoxyParamCaption})}



Delete an O\+SC 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\+SC path of the method to delete. If N\+U\+LL is passed the method will match the generic handler. \\
\hline
{\em typespec} & The typespec the method accepts. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{lo__serverthread_8h_a7bc3d8361b65e3ad112a1da956d9114e}\label{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{\texorpdfstring{lo\_server\_thread\_events\_pending()}{lo\_server\_thread\_events\_pending()}}
{\footnotesize\ttfamily int lo\+\_\+server\+\_\+thread\+\_\+events\+\_\+pending (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}}}]{st }\end{DoxyParamCaption})}



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

\mbox{\Hypertarget{lo__serverthread_8h_ad72be3f2a81b9583ad69dd007080c0e5}\label{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{\texorpdfstring{lo\_server\_thread\_free()}{lo\_server\_thread\_free()}}
{\footnotesize\ttfamily void lo\+\_\+server\+\_\+thread\+\_\+free (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}}}]{st }\end{DoxyParamCaption})}



Free memory taken by a server thread. 

Frees the memory, and, if currently running will stop the associated thread. \mbox{\Hypertarget{lo__serverthread_8h_a22f4b18eeac41490647ab9fe2333f933}\label{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{\texorpdfstring{lo\_server\_thread\_get\_port()}{lo\_server\_thread\_get\_port()}}
{\footnotesize\ttfamily int lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+port (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}}}]{st }\end{DoxyParamCaption})}



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

\mbox{\Hypertarget{lo__serverthread_8h_ab968d51fa6e0d4bea92e3f84f5556161}\label{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{\texorpdfstring{lo\_server\_thread\_get\_server()}{lo\_server\_thread\_get\_server()}}
{\footnotesize\ttfamily \mbox{\hyperlink{lo__types_8h_a59067bf50cf8abb4371da6f03c9036c9}{lo\+\_\+server}} lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+server (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}}}]{st }\end{DoxyParamCaption})}



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

This function is useful for passing a thread\textquotesingle{}s lo\+\_\+server to \mbox{\hyperlink{group__liblo_gaa4a314562b09e2fd00749a5d0b4d0955}{lo\+\_\+send\+\_\+from()}}. \mbox{\Hypertarget{lo__serverthread_8h_ac2805a7cbdd9465be4ca5101c569faf0}\label{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{\texorpdfstring{lo\_server\_thread\_get\_url()}{lo\_server\_thread\_get\_url()}}
{\footnotesize\ttfamily char$\ast$ lo\+\_\+server\+\_\+thread\+\_\+get\+\_\+url (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}}}]{st }\end{DoxyParamCaption})}



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

Return value must be free()\textquotesingle{}d to reclaim memory. \mbox{\Hypertarget{lo__serverthread_8h_abe3e0c31189adfd7624de6c507b610ba}\label{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{\texorpdfstring{lo\_server\_thread\_new()}{lo\_server\_thread\_new()}}
{\footnotesize\ttfamily \mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}} lo\+\_\+server\+\_\+thread\+\_\+new (\begin{DoxyParamCaption}\item[{const char $\ast$}]{port,  }\item[{\mbox{\hyperlink{lo__types_8h_aa4406d5e90db364c02337656e6c95250}{lo\+\_\+err\+\_\+handler}}}]{err\+\_\+h }\end{DoxyParamCaption})}



Create a new server thread to handle incoming O\+SC 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\+LL is passed then an unused port will be chosen by the system, its number may be retrieved with \mbox{\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\+IX 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 \mbox{\hyperlink{lo__types_8h}{lo\+\_\+types.\+h}} \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{lo__serverthread_8h_aac49abadaaac33408eae4060bb44b9a2}\label{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{\texorpdfstring{lo\_server\_thread\_new\_from\_url()}{lo\_server\_thread\_new\_from\_url()}}
{\footnotesize\ttfamily \mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}} lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+from\+\_\+url (\begin{DoxyParamCaption}\item[{const char $\ast$}]{url,  }\item[{\mbox{\hyperlink{lo__types_8h_aa4406d5e90db364c02337656e6c95250}{lo\+\_\+err\+\_\+handler}}}]{err\+\_\+h }\end{DoxyParamCaption})}



Create a new server thread, taking port and the optional multicast group IP from an U\+RL string. 


\begin{DoxyParams}{Parameters}
{\em url} & The U\+RL 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\+LL if you do not want error handling. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A new lo\+\_\+server\+\_\+thread instance. 
\end{DoxyReturn}
\mbox{\Hypertarget{lo__serverthread_8h_a0fa9fcae4eabe09847d46b134dc33aa4}\label{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{\texorpdfstring{lo\_server\_thread\_new\_multicast()}{lo\_server\_thread\_new\_multicast()}}
{\footnotesize\ttfamily \mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}} lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+multicast (\begin{DoxyParamCaption}\item[{const char $\ast$}]{group,  }\item[{const char $\ast$}]{port,  }\item[{\mbox{\hyperlink{lo__types_8h_aa4406d5e90db364c02337656e6c95250}{lo\+\_\+err\+\_\+handler}}}]{err\+\_\+h }\end{DoxyParamCaption})}



Create a new server thread to handle incoming O\+SC messages, and join a U\+DP 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 IP multicast for the acceptable address range; e.\+g., \href{http://tldp.org/HOWTO/Multicast-HOWTO-2.html}{\texttt{ http\+://tldp.\+org/\+H\+O\+W\+T\+O/\+Multicast-\/\+H\+O\+W\+T\+O-\/2.\+html}} \\
\hline
{\em port} & If N\+U\+LL is passed then an unused port will be chosen by the system, its number may be retrieved with \mbox{\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\+IX 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 \mbox{\hyperlink{lo__types_8h}{lo\+\_\+types.\+h}} \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{lo__serverthread_8h_ad6d57101bbdaa6571ed76373b2c3a50a}\label{lo__serverthread_8h_ad6d57101bbdaa6571ed76373b2c3a50a}} 
\index{lo\_serverthread.h@{lo\_serverthread.h}!lo\_server\_thread\_new\_multicast\_iface@{lo\_server\_thread\_new\_multicast\_iface}}
\index{lo\_server\_thread\_new\_multicast\_iface@{lo\_server\_thread\_new\_multicast\_iface}!lo\_serverthread.h@{lo\_serverthread.h}}
\subsubsection{\texorpdfstring{lo\_server\_thread\_new\_multicast\_iface()}{lo\_server\_thread\_new\_multicast\_iface()}}
{\footnotesize\ttfamily \mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}} lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+multicast\+\_\+iface (\begin{DoxyParamCaption}\item[{const char $\ast$}]{group,  }\item[{const char $\ast$}]{port,  }\item[{const char $\ast$}]{iface,  }\item[{const char $\ast$}]{ip,  }\item[{\mbox{\hyperlink{lo__types_8h_aa4406d5e90db364c02337656e6c95250}{lo\+\_\+err\+\_\+handler}}}]{err\+\_\+h }\end{DoxyParamCaption})}



Create a new server thread instance, and join a U\+DP multicast group, optionally specifying which network interface to use. Note that usually only one of iface or ip are specified. 


\begin{DoxyParams}{Parameters}
{\em group} & The multicast group to join. See documentation on IP multicast for the acceptable address range; e.\+g., \href{http://tldp.org/HOWTO/Multicast-HOWTO-2.html}{\texttt{ http\+://tldp.\+org/\+H\+O\+W\+T\+O/\+Multicast-\/\+H\+O\+W\+T\+O-\/2.\+html}} \\
\hline
{\em port} & If using U\+DP then N\+U\+LL may be passed to find an unused port. Otherwise a decimal port number or service name or may be passed. If using U\+N\+IX domain sockets then a socket path should be passed here. \\
\hline
{\em iface} & A string specifying the name of a network interface to use, or zero if not specified. \\
\hline
{\em ip} & A string specifying the IP address of a network interface to use, or zero if not specified. \\
\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\+LL if you do not want error handling. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{lo__serverthread_8h_a6713cedfb0b2c4f066ec8a19366bf095}\label{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{\texorpdfstring{lo\_server\_thread\_new\_with\_proto()}{lo\_server\_thread\_new\_with\_proto()}}
{\footnotesize\ttfamily \mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}} lo\+\_\+server\+\_\+thread\+\_\+new\+\_\+with\+\_\+proto (\begin{DoxyParamCaption}\item[{const char $\ast$}]{port,  }\item[{int}]{proto,  }\item[{\mbox{\hyperlink{lo__types_8h_aa4406d5e90db364c02337656e6c95250}{lo\+\_\+err\+\_\+handler}}}]{err\+\_\+h }\end{DoxyParamCaption})}



Create a new server thread to handle incoming O\+SC 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\+LL is passed then an unused port will be chosen by the system, its number may be retrieved with \mbox{\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\+IX domain socket path may be passed. \\
\hline
{\em proto} & The protocol to use, should be one of L\+O\+\_\+\+U\+DP, L\+O\+\_\+\+T\+CP or L\+O\+\_\+\+U\+N\+IX. \\
\hline
{\em err\+\_\+h} & A function that will be called in the event of an error being raised. The function prototype is defined in \mbox{\hyperlink{lo__types_8h}{lo\+\_\+types.\+h}} \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{lo__serverthread_8h_a6ba794aacbb04dada6939980ce71381a}\label{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{\texorpdfstring{lo\_server\_thread\_pp()}{lo\_server\_thread\_pp()}}
{\footnotesize\ttfamily void lo\+\_\+server\+\_\+thread\+\_\+pp (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}}}]{st }\end{DoxyParamCaption})}



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

\mbox{\Hypertarget{lo__serverthread_8h_ab4d5248ecc0d55e46c0f025e727ceb52}\label{lo__serverthread_8h_ab4d5248ecc0d55e46c0f025e727ceb52}} 
\index{lo\_serverthread.h@{lo\_serverthread.h}!lo\_server\_thread\_set\_callbacks@{lo\_server\_thread\_set\_callbacks}}
\index{lo\_server\_thread\_set\_callbacks@{lo\_server\_thread\_set\_callbacks}!lo\_serverthread.h@{lo\_serverthread.h}}
\subsubsection{\texorpdfstring{lo\_server\_thread\_set\_callbacks()}{lo\_server\_thread\_set\_callbacks()}}
{\footnotesize\ttfamily void lo\+\_\+server\+\_\+thread\+\_\+set\+\_\+callbacks (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}}}]{st,  }\item[{\mbox{\hyperlink{lo__types_8h_aed5d674714d659d776d848d716d9efbc}{lo\+\_\+server\+\_\+thread\+\_\+init\+\_\+callback}}}]{init,  }\item[{\mbox{\hyperlink{lo__types_8h_a2be941151f7a8ae193ba1687b41b2dc4}{lo\+\_\+server\+\_\+thread\+\_\+cleanup\+\_\+callback}}}]{cleanup,  }\item[{void $\ast$}]{user\+\_\+data }\end{DoxyParamCaption})}



Set an init and/or a cleanup function to the specifed server thread. 

To have any effect, it must be called before the server thread is started.


\begin{DoxyParams}{Parameters}
{\em st} & The server thread to which the method is to be added. \\
\hline
{\em init} & The init function to be called just after thread start. May be N\+U\+LL. \\
\hline
{\em cleanup} & The cleanup function to be called just before thread exit. May be N\+U\+LL. \\
\hline
{\em user\+\_\+data} & A value that will be passed to the callback functions. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{lo__serverthread_8h_a4b284c1b96d0354c5de4ff7ba5a44fbc}\label{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{\texorpdfstring{lo\_server\_thread\_start()}{lo\_server\_thread\_start()}}
{\footnotesize\ttfamily int lo\+\_\+server\+\_\+thread\+\_\+start (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}}}]{st }\end{DoxyParamCaption})}



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}
\mbox{\Hypertarget{lo__serverthread_8h_a06992ac46b04e58cb77d7c519a578f57}\label{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{\texorpdfstring{lo\_server\_thread\_stop()}{lo\_server\_thread\_stop()}}
{\footnotesize\ttfamily int lo\+\_\+server\+\_\+thread\+\_\+stop (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{lo__types_8h_a09996ffb6bde21b8fb6106897b88feae}{lo\+\_\+server\+\_\+thread}}}]{st }\end{DoxyParamCaption})}



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}
