1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright © 2009 Codethink Limited
4 * Copyright © 2009 Red Hat, Inc
6 * SPDX-License-Identifier: LGPL-2.1-or-later
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General
19 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
21 * Authors: Ryan Lortie <desrt@desrt.ca>
22 * Alexander Larsson <alexl@redhat.com>
25 #ifndef __G_THREADED_SOCKET_SERVICE_H__
26 #define __G_THREADED_SOCKET_SERVICE_H__
28 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
29 #error "Only <gio/gio.h> can be included directly."
32 #include <gio/gsocketservice.h>
36 #define G_TYPE_THREADED_SOCKET_SERVICE (g_threaded_socket_service_get_type ())
37 #define G_THREADED_SOCKET_SERVICE(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
38 G_TYPE_THREADED_SOCKET_SERVICE, \
39 GThreadedSocketService))
40 #define G_THREADED_SOCKET_SERVICE_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
41 G_TYPE_THREADED_SOCKET_SERVICE, \
42 GThreadedSocketServiceClass))
43 #define G_IS_THREADED_SOCKET_SERVICE(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
44 G_TYPE_THREADED_SOCKET_SERVICE))
45 #define G_IS_THREADED_SOCKET_SERVICE_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
46 G_TYPE_THREADED_SOCKET_SERVICE))
47 #define G_THREADED_SOCKET_SERVICE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
48 G_TYPE_THREADED_SOCKET_SERVICE, \
49 GThreadedSocketServiceClass))
51 typedef struct _GThreadedSocketServicePrivate GThreadedSocketServicePrivate;
52 typedef struct _GThreadedSocketServiceClass GThreadedSocketServiceClass;
54 struct _GThreadedSocketServiceClass
56 GSocketServiceClass parent_class;
58 gboolean (* run) (GThreadedSocketService *service,
59 GSocketConnection *connection,
60 GObject *source_object);
62 /* Padding for future expansion */
63 void (*_g_reserved1) (void);
64 void (*_g_reserved2) (void);
65 void (*_g_reserved3) (void);
66 void (*_g_reserved4) (void);
67 void (*_g_reserved5) (void);
70 struct _GThreadedSocketService
72 GSocketService parent_instance;
73 GThreadedSocketServicePrivate *priv;
77 GType g_threaded_socket_service_get_type (void);
79 GSocketService * g_threaded_socket_service_new (int max_threads);
83 #endif /* __G_THREADED_SOCKET_SERVICE_H__ */