mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 22:16:16 +01:00
Add max_threads argument to g_threaded_socket_service_new
This commit is contained in:
parent
5b683af237
commit
13cb011762
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user