summaryrefslogtreecommitdiff
path: root/examples/sandbox.c
diff options
context:
space:
mode:
authorChris Hiszpanski <chris@hiszpanski.name>2019-04-18 00:55:30 -0700
committerChris Hiszpanski <chris@hiszpanski.name>2021-04-04 01:23:16 -0700
commit6d88c555019f32509f303e23dcfbba824fecd2ee (patch)
tree9d976063b4cb63e2e8ad4529c6d597b4470464c7 /examples/sandbox.c
Initial public commit.
mDNS and SDP are functional. Otherwise, library is still very much a work in progress. All tests pass.
Diffstat (limited to 'examples/sandbox.c')
-rw-r--r--examples/sandbox.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/examples/sandbox.c b/examples/sandbox.c
new file mode 100644
index 0000000..2f3728d
--- /dev/null
+++ b/examples/sandbox.c
@@ -0,0 +1,33 @@
+#include <signal.h>
+#include <unistd.h>
+
+#include "mdns.h"
+#include "urtc.h"
+
+
+int main() {
+ sigset_t ss;
+ int signal;
+
+ const char *stun[] = {
+ "stun.l.google.com:19302",
+ "stun2.l.google.com:19302",
+ NULL
+ };
+
+ sigemptyset(&ss);
+ sigaddset(&ss, SIGINT);
+ sigaddset(&ss, SIGTERM);
+ sigaddset(&ss, SIGQUIT);
+
+ urtc_peerconn_t *pc = urtc_peerconn_create(stun);
+
+ // query for raspberry.local
+ mdns_query("raspberry");
+
+ sigwait(&ss, &signal);
+
+ urtc_peerconn_destroy(pc);
+
+ return 0;
+}