summaryrefslogtreecommitdiff
path: root/examples/sandbox.c
blob: 2f3728d65e22a8a36230bf724bd4ae6e1f70696c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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;
}