lo_serverthread.h(3)
β¨ lo_serverthread.h(3) β¨
okay bestie, sit down, hydrate, and let's talk about lo_serverthread.h(3) β the liblo manual page that's literally all about threads and it's giving main character energy. π§΅π
πΈ NAME πΈ
lo_serverthread.h
that's it, that's the name, short and iconic π
π¦ SYNOPSIS π¦
β¨ Functions β¨
bestie, this is the whole roster. every single one, no skips, no cap. π
π«Ά lo_server_thread_new
lo_server_thread lo_server_thread_new (const char *port, lo_err_handler err_h)
Spin up a brand new server thread that catches all your incoming OSC messages. Your lil inbox for OSC, basically. β¨
π lo_server_thread_new_multicast
lo_server_thread lo_server_thread_new_multicast (const char *group, const char *port, lo_err_handler err_h)
Same deal β a new server thread handling incoming OSC messages β but this one also joins a UDP multicast group. It's a group chat. Literally. π
π¦ lo_server_thread_new_multicast_iface
lo_server_thread lo_server_thread_new_multicast_iface (const char *group, const char *port, const char *iface, const char *ip, lo_err_handler err_h)
Make a new server thread instance AND join a UDP multicast group, with the option to say which network interface to use. Quick note bestie: usually you only set one of iface or ip, not both. Pick a lane, she's not greedy. π
β lo_server_thread_new_with_proto
lo_server_thread lo_server_thread_new_with_proto (const char *port, int proto, lo_err_handler err_h)
New server thread for incoming OSC messages, except this time you get to specify the protocol yourself. Choose your own adventure. π₯
π lo_server_thread_new_from_url
lo_server_thread lo_server_thread_new_from_url (const char *url, lo_err_handler err_h)
Builds a new server thread by pulling the port β and the optional multicast group IP β straight out of a URL string. It's the "just read it off the link" moment. π
πΈ lo_server_thread_new_from_config
lo_server_thread lo_server_thread_new_from_config (lo_server_config *config)
New server thread, but sourced from a configuration struct. Fancy. Structured. Organized queen behavior. β¨
π lo_server_thread_free
void lo_server_thread_free (lo_server_thread st)
Releases the memory that a server thread was hogging. Give her back to the void. π¦
π lo_server_thread_add_method
lo_method lo_server_thread_add_method (lo_server_thread st, const char *path, const char *typespec, lo_method_handler h, const void *user_data)
Adds an OSC method to the specified server thread. New method, who dis. π
π lo_server_thread_del_method
void lo_server_thread_del_method (lo_server_thread st, const char *path, const char *typespec)
Deletes an OSC method from the specified server thread. Bye bestie, it's not personal. π
π₯ lo_server_thread_del_lo_method
int lo_server_thread_del_lo_method (lo_server_thread st, lo_method m)
Also deletes an OSC method from the specified server thread, but this one takes the method itself instead of a path and typespec. Same energy, different doorway. β¨
π§ lo_server_thread_set_callbacks
void lo_server_thread_set_callbacks (lo_server_thread st, lo_server_thread_init_callback init, lo_server_thread_cleanup_callback cleanup, void *user_data)
Hooks up an init and/or a cleanup function to the specified server thread. Setting the vibe for when she starts and when she says goodnight. πΈ
π lo_server_thread_start
int lo_server_thread_start (lo_server_thread st)
Starts the server thread. Go girl, go. π
π lo_server_thread_stop
int lo_server_thread_stop (lo_server_thread st)
Stops the server thread. Nap time, deserved. π€
β lo_server_thread_get_port
int lo_server_thread_get_port (lo_server_thread st)
Hands you back the port number the server thread has bound to. "What port are you on" but she actually answers. π
π lo_server_thread_get_url
char * lo_server_thread_get_url (lo_server_thread st)
Returns a URL that describes the address of the server thread. Her little business card. π
π lo_server_thread_get_server
lo_server lo_server_thread_get_server (lo_server_thread st)
Gives you the lo_server sitting inside a lo_server_thread. The thread's inner self, exposed. π¦
β¨ lo_server_thread_events_pending
int lo_server_thread_events_pending (lo_server_thread st)
Returns true if there are scheduled events (like, from bundles) just waiting for the thread to dispatch them. The "you have unread messages" of OSC. π¬
π
lo_server_thread_pp
void lo_server_thread_pp (lo_server_thread st)
Pretty-prints a lo_server_thread object. Glow-up for your eyeballs, no notes. π
π Detailed Description π
The liblo headerfile declaring thread-related functions. That's the whole vibe: it's the header that announces all the thread stuff. π§΅π
Definition in file lo_serverthread.h. πΈ
and bestieβ¦ there's literally more π
π§ FUNCTION DOCUMENTATION π§
okay bestie, this is the part where we meet every single function in lo_serverthread.h one by one, no skipping, no skimming, we're reading the whole menu π
each one gets its own lil spotlight, its signature, its params, its returns, all of it. let's gooo π¦
π lo_method lo_server_thread_add_method (lo_server_thread st, const char * path, const char * typespec, lo_method_handler h, const void * user_data)
Add an OSC method to the specifed server thread. this is the "hey server, when a message like this shows up, run this" move β¨
Parameters
stβ the server thread the method is to be added to.pathβ the OSC path to register the method to. ifNULLis passed, the method will match all paths. literally all of them, she's for everybody π«Ά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. so she'll meet you where you're at, type-wise.hβ the method handler callback function that will be called it a matching message is received.user_dataβ a value that will be passed to the callback function,h, when its invoked matching from this method.
πΈ int lo_server_thread_del_lo_method (lo_server_thread st, lo_method m)
Delete an OSC method from the specified server thread. bye bestie π
Parameters
stβ the server thread the method is to be removed from.mβ thelo_methodidentifier returned fromlo_server_add_methodfor the method to delete from the server.
Returns
Non-zero if it was not found in the list of methods for the server.
π void lo_server_thread_del_method (lo_server_thread st, const char * path, const char * typespec)
Delete an OSC method from the specifed server thread β this time you point at it by path + typespec instead of by handle.
Parameters
stβ the server thread the method is to be removed from.pathβ the OSC path of the method to delete. ifNULLis passed the method will match the generic handler.typespecβ the typespec the method accepts.
π¦ int lo_server_thread_events_pending (lo_server_thread st)
Return true if there are scheduled events (eg. from bundles) waiting to be dispatched by the thread. yes queen, the queue is not empty, something's coming π
π void lo_server_thread_free (lo_server_thread st)
Free memory taken by a server thread. frees the memory, and, if currently running will stop the associated thread. so it's not just a clean-up, it will shut her down too. no cap.
β int lo_server_thread_get_port (lo_server_thread st)
Return the port number that the server thread has bound to. the receipts, basically π§Ύ
π lo_server lo_server_thread_get_server (lo_server_thread st)
Return the lo_server for a lo_server_thread. this function is useful for passing a thread's lo_server to lo_send_from(). iykyk π«
π char * lo_server_thread_get_url (lo_server_thread st)
Return a URL describing the address of the server thread.
bestie listen: the return value must be free()'d to reclaim memory. she's not gonna do it for you. free her or leak her, your call π
π lo_server_thread lo_server_thread_new (const char * port, lo_err_handler err_h)
Create a new server thread to handle incoming OSC 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 β she's got it, main character energy fr fr π
Parameters
portβ ifNULLis passed then an unused port will be chosen by the system, its number may be retrieved withlo_server_thread_get_port()so it can be passed to clients. otherwise a decimal port number, service name or UNIX domain socket path may be passed.err_hβ a function that will be called in the event of an error being raised. the function prototype is defined inlo_types.h.
π§ lo_server_thread lo_server_thread_new_from_config (lo_server_config * config)
Create a new server thread, using a configuration struct. plug-and-play era β¨
Parameters
configβ a pre-initialized config struct. a pointer to it will not be kept.
Returns
A new lo_server_thread instance.
π₯ lo_server_thread lo_server_thread_new_from_url (const char * url, lo_err_handler err_h)
Create a new server thread, taking port and the optional multicast group IP from an URL string. very demure, very URL π
Parameters
urlβ the URL to specify the server parameters.err_hβ an error callback function that will be called if there is an error in messge reception or server creation. passNULLif you do not want error handling.
Returns
A new lo_server_thread instance.
π lo_server_thread lo_server_thread_new_multicast (const char * group, const char * port, lo_err_handler err_h)
Create a new server thread to handle incoming OSC messages, and join a UDP 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.
Parameters
groupβ the multicast group to join. see documentation on IP multicast for the acceptable address range; e.g.,http://tldp.org/HOWTO/Multicast-HOWTO-2.htmlportβ ifNULLis passed then an unused port will be chosen by the system, its number may be retrieved withlo_server_thread_get_port()so it can be passed to clients. otherwise a decimal port number, service name or UNIX domain socket path may be passed.err_hβ a function that will be called in the event of an error being raised. the function prototype is defined inlo_types.h.
π lo_server_thread lo_server_thread_new_multicast_iface (const char * group, const char * port, const char * iface, const char * ip, lo_err_handler err_h)
Create a new server thread instance, and join a UDP multicast group, optionally specifying which network interface to use.
note: usually only one ofifaceoripare specified. not both, bestie, pick a lane πΈ
Parameters
groupβ the multicast group to join. see documentation on IP multicast for the acceptable address range; e.g.,http://tldp.org/HOWTO/Multicast-HOWTO-2.htmlportβ if using UDP thenNULLmay be passed to find an unused port. otherwise a decimal port number or service name or may be passed. if using UNIX domain sockets then a socket path should be passed here.ifaceβ a string specifying the name of a network interface to use, or zero if not specified.ipβ a string specifying the IP address of a network interface to use, or zero if not specified.err_hβ an error callback function that will be called if there is an error in messge reception or server creation. passNULLif you do not want error handling.
π lo_server_thread lo_server_thread_new_with_proto (const char * port, int proto, lo_err_handler err_h)
Create a new server thread to handle incoming OSC 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.
Parameters
portβ ifNULLis passed then an unused port will be chosen by the system, its number may be retrieved withlo_server_thread_get_port()so it can be passed to clients. otherwise a decimal port number, service name or UNIX domain socket path may be passed.protoβ the protocol to use, should be one ofLO_UDP,LO_TCPorLO_UNIX.err_hβ a function that will be called in the event of an error being raised. the function prototype is defined inlo_types.h.
π«Ά void lo_server_thread_pp (lo_server_thread st)
Pretty-print a lo_server_thread object. she said "let me look cute for the terminal" π
β¨ void lo_server_thread_set_callbacks (lo_server_thread st, lo_server_thread_init_callback init, lo_server_thread_cleanup_callback cleanup, void * user_data)
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. timing is everything, bestie, no exceptions.
Parameters
stβ the server thread to which the method is to be added.initβ the init function to be called just after thread start. may beNULL.cleanupβ the cleanup function to be called just before thread exit. may beNULL.user_dataβ a value that will be passed to the callback functions.
π int lo_server_thread_start (lo_server_thread st)
Start the server thread. go girl, go π
Parameters
stβ the server thread to start.
Returns
Less than 0 on failure, 0 on success.
π int lo_server_thread_stop (lo_server_thread st)
Stop the server thread. that's a wrap, periodt.
Parameters
stβ the server thread to start.
Returns
Less than 0 on failure, 0 on success.
π AUTHOR π
Generated automatically by Doxygen for liblo from the source code. (not me, i just added the sparkle π)
and that's the whole page, bestie!! π this whole thing is liblo, Version 0.34, from lo_serverthread.h(3). go forth and thread your OSC servers responsibly, mwah ππ¦β¨
π¦ where this page comes from
- fedora 44: liblo-devel 0.34-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: liblo-devel 0.34-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms