Commit 13cb0117 authored by Alexander Larsson's avatar Alexander Larsson

Add max_threads argument to g_threaded_socket_service_new

parent 5b683af2
......@@ -201,12 +201,14 @@ g_threaded_socket_service_class_init (GThreadedSocketServiceClass *class)
/**
* g_threaded_socket_service_new:
* @returns: a new #GSocketService.
* @max_threads: the maximal number of threads to execute concurrently
* handling incomming clients, -1 means no limit
*
* Creates a new #GThreadedSocketService with no listeners. Listeners
* must be added with g_socket_service_add_listeners().
**/
GSocketService *
g_threaded_socket_service_new (void)
g_threaded_socket_service_new (int max_threads)
{
return g_object_new (G_TYPE_THREADED_SOCKET_SERVICE, NULL);
}
......
......@@ -74,7 +74,7 @@ struct _GThreadedSocketService
};
GType g_threaded_socket_service_get_type (void);
GSocketService * g_threaded_socket_service_new (void);
GSocketService * g_threaded_socket_service_new (int max_threads);
G_END_DECLS
......
......@@ -53,7 +53,7 @@ main (int argc, char *argv[])
return 1;
}
service = g_threaded_socket_service_new ();
service = g_threaded_socket_service_new (10);
if (!g_socket_listener_add_inet_port (G_SOCKET_LISTENER (service),
port,
......
......@@ -164,7 +164,7 @@ main (int argc, char *argv[])
root = g_strdup (argv[1]);
service = g_threaded_socket_service_new ();
service = g_threaded_socket_service_new (10);
if (!g_socket_listener_add_inet_port (G_SOCKET_LISTENER (service),
port,
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