1 #include <sys/socket.h>
2 #include <netinet/in.h>
7 static GMainLoop *loop = NULL;
9 static gboolean timeout(gpointer data) {
10 g_main_loop_quit(loop);
14 int main(int argc, char *argv[]) {
16 flxLocalAddrSource *l;
20 flx = flx_server_new(NULL);
22 l = flx_local_addr_source_new(flx);
24 flx_address_parse("127.0.0.1", AF_INET, &a);
25 flx_server_add_address(flx, 0, 0, AF_UNSPEC, "localhost", &a);
27 flx_address_parse("::1", AF_INET6, &a);
28 flx_server_add_address(flx, 0, 0, AF_UNSPEC, "ip6-localhost", &a);
30 g_timeout_add(1000, timeout, NULL);
32 loop = g_main_loop_new(NULL, FALSE);
33 g_main_loop_run(loop);
34 g_main_loop_unref(loop);
36 flx_server_dump(flx, stdout);
38 flx_local_addr_source_free(l);