Set the listen backlog before calling listen.

If we set it after it won't be used.
This commit is contained in:
Alexander Larsson 2009-05-19 12:06:29 +02:00
parent 64383fa3d9
commit 18373cfbe8

View File

@ -235,7 +235,6 @@ g_socket_listener_add_socket (GSocketListener *listener,
} }
g_ptr_array_add (listener->priv->sockets, socket); g_ptr_array_add (listener->priv->sockets, socket);
g_socket_set_listen_backlog (socket, listener->priv->listen_backlog);
if (source_object) if (source_object)
g_object_set_qdata_full (G_OBJECT (socket), source_quark, g_object_set_qdata_full (G_OBJECT (socket), source_quark,
@ -286,6 +285,8 @@ g_socket_listener_add_address (GSocketListener *listener,
if (socket == NULL) if (socket == NULL)
return FALSE; return FALSE;
g_socket_set_listen_backlog (socket, listener->priv->listen_backlog);
if (!g_socket_bind (socket, address, TRUE, error) || if (!g_socket_bind (socket, address, TRUE, error) ||
!g_socket_listen (socket, error) || !g_socket_listen (socket, error) ||
!g_socket_listener_add_socket (listener, socket, !g_socket_listener_add_socket (listener, socket,