Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
gsocketlistener.h
Go to the documentation of this file.
1/* GIO - GLib Input, Output and Streaming Library
2 *
3 * Copyright © 2008 Christian Kellner, Samuel Cormier-Iijima
4 * Copyright © 2009 Codethink Limited
5 * Copyright © 2009 Red Hat, Inc
6 *
7 * SPDX-License-Identifier: LGPL-2.1-or-later
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General
20 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
21 *
22 * Authors: Christian Kellner <gicmo@gnome.org>
23 * Samuel Cormier-Iijima <sciyoshi@gmail.com>
24 * Ryan Lortie <desrt@desrt.ca>
25 * Alexander Larsson <alexl@redhat.com>
26 */
27
28#ifndef __G_SOCKET_LISTENER_H__
29#define __G_SOCKET_LISTENER_H__
30
31#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
32#error "Only <gio/gio.h> can be included directly."
33#endif
34
35#include <gio/giotypes.h>
36
38
39#define G_TYPE_SOCKET_LISTENER (g_socket_listener_get_type ())
40#define G_SOCKET_LISTENER(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
41 G_TYPE_SOCKET_LISTENER, GSocketListener))
42#define G_SOCKET_LISTENER_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
43 G_TYPE_SOCKET_LISTENER, GSocketListenerClass))
44#define G_IS_SOCKET_LISTENER(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
45 G_TYPE_SOCKET_LISTENER))
46#define G_IS_SOCKET_LISTENER_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
47 G_TYPE_SOCKET_LISTENER))
48#define G_SOCKET_LISTENER_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
49 G_TYPE_SOCKET_LISTENER, GSocketListenerClass))
50
51typedef struct _GSocketListenerPrivate GSocketListenerPrivate;
53
54/**
55 * GSocketListenerClass:
56 * @changed: virtual method called when the set of socket listened to changes
57 *
58 * Class structure for #GSocketListener.
59 **/
61{
63
64 void (* changed) (GSocketListener *listener);
65
66 void (* event) (GSocketListener *listener,
69
70 /* Padding for future expansion */
71 void (*_g_reserved2) (void);
72 void (*_g_reserved3) (void);
73 void (*_g_reserved4) (void);
74 void (*_g_reserved5) (void);
75 void (*_g_reserved6) (void);
76};
77
83
86
89
92 int listen_backlog);
93
97 GObject *source_object,
98 GError **error);
101 GSocketAddress *address,
102 GSocketType type,
103 GSocketProtocol protocol,
104 GObject *source_object,
105 GSocketAddress **effective_address,
106 GError **error);
109 guint16 port,
110 GObject *source_object,
111 GError **error);
114 GObject *source_object,
115 GError **error);
116
119 GObject **source_object,
120 GCancellable *cancellable,
121 GError **error);
124 GCancellable *cancellable,
125 GAsyncReadyCallback callback,
126 gpointer user_data);
129 GAsyncResult *result,
130 GObject **source_object,
131 GError **error);
132
133
136 GObject **source_object,
137 GCancellable *cancellable,
138 GError **error);
139
142 GCancellable *cancellable,
143 GAsyncReadyCallback callback,
144 gpointer user_data);
145
148 GAsyncResult *result,
149 GObject **source_object,
150 GError **error);
151
154
156
157#endif /* __G_SOCKET_LISTENER_H__ */
#define GIO_AVAILABLE_IN_ALL
GSocketType
Definition gioenums.h:857
GSocketListenerEvent
Definition gioenums.h:1976
GSocketProtocol
Definition gioenums.h:907
struct _GAsyncResult GAsyncResult
Definition giotypes.h:36
void(* GAsyncReadyCallback)(GObject *source_object, GAsyncResult *res, gpointer data)
Definition giotypes.h:190
unsigned short guint16
Definition glibconfig.h:49
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
#define G_GNUC_CONST
Definition gmacros.h:637
GIO_AVAILABLE_IN_ALL void g_socket_listener_close(GSocketListener *listener)
GIO_AVAILABLE_IN_ALL gboolean g_socket_listener_add_socket(GSocketListener *listener, GSocket *socket, GObject *source_object, GError **error)
GIO_AVAILABLE_IN_ALL GSocketListener * g_socket_listener_new(void)
GIO_AVAILABLE_IN_ALL void g_socket_listener_accept_socket_async(GSocketListener *listener, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
GIO_AVAILABLE_IN_ALL gboolean g_socket_listener_add_inet_port(GSocketListener *listener, guint16 port, GObject *source_object, GError **error)
GIO_AVAILABLE_IN_ALL void g_socket_listener_accept_async(GSocketListener *listener, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
GIO_AVAILABLE_IN_ALL GType g_socket_listener_get_type(void) G_GNUC_CONST
struct _GSocketListenerPrivate GSocketListenerPrivate
GIO_AVAILABLE_IN_ALL gboolean g_socket_listener_add_address(GSocketListener *listener, GSocketAddress *address, GSocketType type, GSocketProtocol protocol, GObject *source_object, GSocketAddress **effective_address, GError **error)
GIO_AVAILABLE_IN_ALL GSocket * g_socket_listener_accept_socket(GSocketListener *listener, GObject **source_object, GCancellable *cancellable, GError **error)
GIO_AVAILABLE_IN_ALL GSocket * g_socket_listener_accept_socket_finish(GSocketListener *listener, GAsyncResult *result, GObject **source_object, GError **error)
GIO_AVAILABLE_IN_ALL guint16 g_socket_listener_add_any_inet_port(GSocketListener *listener, GObject *source_object, GError **error)
GIO_AVAILABLE_IN_ALL GSocketConnection * g_socket_listener_accept(GSocketListener *listener, GObject **source_object, GCancellable *cancellable, GError **error)
GIO_AVAILABLE_IN_ALL void g_socket_listener_set_backlog(GSocketListener *listener, int listen_backlog)
GIO_AVAILABLE_IN_ALL GSocketConnection * g_socket_listener_accept_finish(GSocketListener *listener, GAsyncResult *result, GObject **source_object, GError **error)
gsize GType
Definition gtype.h:427
gint gboolean
Definition gtypes.h:56
void * gpointer
Definition gtypes.h:109
static void error(LoadState *S, const char *why)
void(* _g_reserved4)(void)
void(* _g_reserved5)(void)
void(* _g_reserved2)(void)
void(* _g_reserved3)(void)
void(* changed)(GSocketListener *listener)
void(* _g_reserved6)(void)
void(* event)(GSocketListener *listener, GSocketListenerEvent event, GSocket *socket)
GSocketListenerPrivate * priv