#include <stdio.h>
#include <string.h>
#include <ctype.h>
-#include <unistd.h>
#include <agent.h>
+#include <gio/gnetworking.h>
+
static GMainLoop *gloop;
static gchar *stun_addr = NULL;
static guint stun_port;
#if !GLIB_CHECK_VERSION(2, 36, 0)
g_type_init();
#endif
+ g_networking_init();
gloop = g_main_loop_new(NULL, FALSE);
gchar *line = NULL;
gchar *sdp, *sdp64;
+#ifdef G_OS_WIN32
+ io_stdin = g_io_channel_win32_new(_fileno(stdin));
+#else
io_stdin = g_io_channel_unix_new(fileno(stdin));
- g_io_channel_set_flags (io_stdin, G_IO_FLAG_NONBLOCK, NULL);
+#endif
+ g_io_channel_set_flags(io_stdin, G_IO_FLAG_NONBLOCK, NULL);
// Create the nice agent
agent = nice_agent_new(g_main_loop_get_context (gloop),
g_free (sdp);
g_free (line);
} else if (s == G_IO_STATUS_AGAIN) {
- usleep (100000);
+ g_usleep (100000);
}
}
printf("> ");
fflush (stdout);
} else if (s == G_IO_STATUS_AGAIN) {
- usleep (100000);
+ g_usleep (100000);
} else {
// Ctrl-D was pressed.
nice_agent_send(agent, stream_id, 1, 1, "\0");
#include <string.h>
#include <ctype.h>
+#include <gio/gnetworking.h>
+
#include <agent.h>
+
static GMainLoop *gloop;
static GIOChannel* io_stdin;
static guint stream_id;
#if !GLIB_CHECK_VERSION(2, 36, 0)
g_type_init();
#endif
+ g_networking_init();
gloop = g_main_loop_new(NULL, FALSE);
+#ifdef G_OS_WIN32
+ io_stdin = g_io_channel_win32_new(_fileno(stdin));
+#else
io_stdin = g_io_channel_unix_new(fileno(stdin));
+#endif
// Create the nice agent
agent = nice_agent_new(g_main_loop_get_context (gloop),
#include <stdio.h>
#include <string.h>
#include <ctype.h>
-#include <unistd.h>
#include <agent.h>
+#include <gio/gnetworking.h>
+
static GMainLoop *gloop;
static gchar *stun_addr = NULL;
static guint stun_port;
#if !GLIB_CHECK_VERSION(2, 36, 0)
g_type_init();
#endif
+ g_networking_init();
gloop = g_main_loop_new(NULL, FALSE);
gchar *line = NULL;
int rval;
+#ifdef G_OS_WIN32
+ io_stdin = g_io_channel_win32_new(_fileno(stdin));
+#else
io_stdin = g_io_channel_unix_new(fileno(stdin));
+#endif
g_io_channel_set_flags (io_stdin, G_IO_FLAG_NONBLOCK, NULL);
// Create the nice agent
}
g_free (line);
} else if (s == G_IO_STATUS_AGAIN) {
- usleep (100000);
+ g_usleep (100000);
}
}
printf("> ");
fflush (stdout);
} else if (s == G_IO_STATUS_AGAIN) {
- usleep (100000);
+ g_usleep (100000);
} else {
// Ctrl-D was pressed.
nice_agent_send(agent, stream_id, 1, 1, "\0");