diff options
author | Thomas White <taw@physics.org> | 2023-04-22 16:06:52 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2023-04-22 16:06:52 +0200 |
commit | df4cc49a3b463ecaca1547593157024a0850d12b (patch) | |
tree | 0aed4c5789d335f1cfbbdf5326b4c1e6d0a0913e | |
parent | 24ddf3f4bd754478a7880586b93dc1342a34001b (diff) |
make-osc-server-thread: Take URL instead of port number
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | guile-osc.c | 6 |
2 files changed, 4 insertions, 4 deletions
@@ -24,7 +24,7 @@ Then, to receive OSC messages from within a Guile program: ``` (use-modules (open-sound-control server-thread)) -(define osc-server (make-osc-server-thread "7770")) +(define osc-server (make-osc-server-thread "osc.udp://localhost:7770")) (add-osc-method osc-server "/my/osc/method" ;; Method name diff --git a/guile-osc.c b/guile-osc.c index 75f1a2b..97dbba6 100644 --- a/guile-osc.c +++ b/guile-osc.c @@ -37,10 +37,10 @@ static void error_callback(int num, const char *msg, const char *path) } -static SCM make_osc_server_thread(SCM port_obj) +static SCM make_osc_server_thread(SCM url_obj) { - const char *port = scm_to_utf8_stringn(port_obj, NULL); - lo_server_thread srv = lo_server_thread_new(port, error_callback); + const char *url = scm_to_utf8_stringn(url_obj, NULL); + lo_server_thread srv = lo_server_thread_new_from_url(url, error_callback); if ( srv == NULL ) { return SCM_BOOL_F; } else { |