Commit ecc2dcc9 authored by Filippo Della Betta's avatar Filippo Della Betta Committed by Youness Alaoui

Use g_io_channel_win32_new_socket for windows

As glib documentation suggests (http://developer.gnome.org/glib/2.28/glib-IO-Channels.html),
g_io_channel_unix_new should be avoided on WIN32 platform.
Replaced with g_io_channel_win32_new_socket function
parent db6f5f33
......@@ -2678,8 +2678,11 @@ agent_attach_stream_component_socket (NiceAgent *agent,
if (!component->ctx)
return;
#ifndef G_OS_WIN32
io = g_io_channel_unix_new (socket->fileno);
#else
io = g_io_channel_win32_new_socket (socket->fileno);
#endif
/* note: without G_IO_ERR the glib mainloop goes into
* busyloop if errors are encountered */
source = g_io_create_watch (io, G_IO_IN | G_IO_ERR);
......
......@@ -387,7 +387,11 @@ add_to_be_sent (NiceSocket *sock, const gchar *buf, guint len, gboolean head)
g_queue_push_tail (&priv->send_queue, tbs);
if (priv->io_channel == NULL) {
#ifndef G_OS_WIN32
priv->io_channel = g_io_channel_unix_new (sock->fileno);
#else
priv->io_channel = g_io_channel_win32_new_socket (sock->fileno);
#endif
priv->io_source = g_io_create_watch (priv->io_channel, G_IO_OUT);
g_source_set_callback (priv->io_source, (GSourceFunc) socket_send_more,
sock, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment