File indexing completed on 2025-01-18 09:59:59
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 #ifndef __G_SOCKET_LISTENER_H__
0029 #define __G_SOCKET_LISTENER_H__
0030
0031 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0032 #error "Only <gio/gio.h> can be included directly."
0033 #endif
0034
0035 #include <gio/giotypes.h>
0036
0037 G_BEGIN_DECLS
0038
0039 #define G_TYPE_SOCKET_LISTENER (g_socket_listener_get_type ())
0040 #define G_SOCKET_LISTENER(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
0041 G_TYPE_SOCKET_LISTENER, GSocketListener))
0042 #define G_SOCKET_LISTENER_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
0043 G_TYPE_SOCKET_LISTENER, GSocketListenerClass))
0044 #define G_IS_SOCKET_LISTENER(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
0045 G_TYPE_SOCKET_LISTENER))
0046 #define G_IS_SOCKET_LISTENER_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
0047 G_TYPE_SOCKET_LISTENER))
0048 #define G_SOCKET_LISTENER_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
0049 G_TYPE_SOCKET_LISTENER, GSocketListenerClass))
0050
0051 typedef struct _GSocketListenerPrivate GSocketListenerPrivate;
0052 typedef struct _GSocketListenerClass GSocketListenerClass;
0053
0054
0055
0056
0057
0058
0059
0060 struct _GSocketListenerClass
0061 {
0062 GObjectClass parent_class;
0063
0064 void (* changed) (GSocketListener *listener);
0065
0066 void (* event) (GSocketListener *listener,
0067 GSocketListenerEvent event,
0068 GSocket *socket);
0069
0070
0071 void (*_g_reserved2) (void);
0072 void (*_g_reserved3) (void);
0073 void (*_g_reserved4) (void);
0074 void (*_g_reserved5) (void);
0075 void (*_g_reserved6) (void);
0076 };
0077
0078 struct _GSocketListener
0079 {
0080 GObject parent_instance;
0081 GSocketListenerPrivate *priv;
0082 };
0083
0084 GIO_AVAILABLE_IN_ALL
0085 GType g_socket_listener_get_type (void) G_GNUC_CONST;
0086
0087 GIO_AVAILABLE_IN_ALL
0088 GSocketListener * g_socket_listener_new (void);
0089
0090 GIO_AVAILABLE_IN_ALL
0091 void g_socket_listener_set_backlog (GSocketListener *listener,
0092 int listen_backlog);
0093
0094 GIO_AVAILABLE_IN_ALL
0095 gboolean g_socket_listener_add_socket (GSocketListener *listener,
0096 GSocket *socket,
0097 GObject *source_object,
0098 GError **error);
0099 GIO_AVAILABLE_IN_ALL
0100 gboolean g_socket_listener_add_address (GSocketListener *listener,
0101 GSocketAddress *address,
0102 GSocketType type,
0103 GSocketProtocol protocol,
0104 GObject *source_object,
0105 GSocketAddress **effective_address,
0106 GError **error);
0107 GIO_AVAILABLE_IN_ALL
0108 gboolean g_socket_listener_add_inet_port (GSocketListener *listener,
0109 guint16 port,
0110 GObject *source_object,
0111 GError **error);
0112 GIO_AVAILABLE_IN_ALL
0113 guint16 g_socket_listener_add_any_inet_port (GSocketListener *listener,
0114 GObject *source_object,
0115 GError **error);
0116
0117 GIO_AVAILABLE_IN_ALL
0118 GSocket * g_socket_listener_accept_socket (GSocketListener *listener,
0119 GObject **source_object,
0120 GCancellable *cancellable,
0121 GError **error);
0122 GIO_AVAILABLE_IN_ALL
0123 void g_socket_listener_accept_socket_async (GSocketListener *listener,
0124 GCancellable *cancellable,
0125 GAsyncReadyCallback callback,
0126 gpointer user_data);
0127 GIO_AVAILABLE_IN_ALL
0128 GSocket * g_socket_listener_accept_socket_finish (GSocketListener *listener,
0129 GAsyncResult *result,
0130 GObject **source_object,
0131 GError **error);
0132
0133
0134 GIO_AVAILABLE_IN_ALL
0135 GSocketConnection * g_socket_listener_accept (GSocketListener *listener,
0136 GObject **source_object,
0137 GCancellable *cancellable,
0138 GError **error);
0139
0140 GIO_AVAILABLE_IN_ALL
0141 void g_socket_listener_accept_async (GSocketListener *listener,
0142 GCancellable *cancellable,
0143 GAsyncReadyCallback callback,
0144 gpointer user_data);
0145
0146 GIO_AVAILABLE_IN_ALL
0147 GSocketConnection * g_socket_listener_accept_finish (GSocketListener *listener,
0148 GAsyncResult *result,
0149 GObject **source_object,
0150 GError **error);
0151
0152 GIO_AVAILABLE_IN_ALL
0153 void g_socket_listener_close (GSocketListener *listener);
0154
0155 G_END_DECLS
0156
0157 #endif