Created
August 3, 2014 02:57
-
-
Save briansorahan/33c8c545b706bd381de4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <lo/lo.h> | |
#include <lo/lo_types.h> | |
void | |
lo_err(int num, | |
const char *msg, | |
const char *where) | |
{ | |
fprintf(stderr, "lo_err %d [%s] %s\n", num, where, msg); | |
} | |
int | |
trace_handler(const char *path, | |
const char *types, | |
lo_arg **argv, | |
int argc, | |
lo_message msg, | |
void *data) | |
{ | |
printf("trace_handler %s,%s\n", path, types); | |
} | |
int | |
path_handler(const char *path, | |
const char *types, | |
lo_arg **argv, | |
int argc, | |
lo_message msg, | |
void *data) | |
{ | |
printf("path_handler %s,%s\n", path, types); | |
} | |
int main() | |
{ | |
const char *port = "41068"; | |
lo_server server = lo_server_new(port, lo_err); | |
lo_server_add_method(server, NULL, NULL, trace_handler, NULL); | |
lo_server_add_method(server, "/lightning/kits/default/samples/*", | |
"ff", path_handler, NULL); | |
while (1) { | |
lo_server_recv(server); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment