6b7349b7c75b5081d1208f25cc6eb6837a2453f2
[cascardo/gnio.git] / gnio / gtcpserver.c
1 /* GNIO - GLib Network Layer of GIO
2  *
3  * Copyright (C) 2008 Christian Kellner, Samuel Cormier-Iijima
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General
16  * Public License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18  * Boston, MA 02111-1307, USA.
19  *
20  * Authors: Christian Kellner <gicmo@gnome.org>
21  *          Samuel Cormier-Iijima <sciyoshi@gmail.com>
22  */
23
24 #include <config.h>
25 #include <glib.h>
26 #include <gio/gio.h>
27 #include <gio/gasynchelper.h>
28
29 #include <string.h>
30 #include <errno.h>
31
32 #include "ginetaddress.h"
33 #include "ginet4address.h"
34 #include "ginet6address.h"
35 #include "gsocket.h"
36 #include "gtcpserver.h"
37 #include "gnioerror.h"
38 #include "ginetsocketaddress.h"
39
40 G_DEFINE_TYPE (GTcpServer, g_tcp_server, G_TYPE_OBJECT);
41
42 enum
43 {
44   PROP_0
45 };
46
47 struct _GTcpServerPrivate
48 {
49
50 };
51
52 static void
53 g_tcp_server_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
54 {
55   GTcpServer *server = G_TCP_SERVER (object);
56
57   switch (prop_id)
58     {
59       default:
60         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
61     }
62 }
63
64 static void
65 g_tcp_server_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
66 {
67   GTcpServer *server = G_TCP_SERVER (object);
68
69   switch (prop_id)
70     {
71       default:
72         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
73     }
74 }
75
76 static void
77 g_tcp_server_finalize (GObject *object)
78 {
79   GTcpServer *server = G_TCP_SERVER (object);
80
81   if (G_OBJECT_CLASS (g_tcp_server_parent_class)->finalize)
82     (*G_OBJECT_CLASS (g_tcp_server_parent_class)->finalize) (object);
83 }
84
85 static void
86 g_tcp_server_dispose (GObject *object)
87 {
88   GTcpServer *server = G_TCP_SERVER (object);
89
90   if (G_OBJECT_CLASS (g_tcp_server_parent_class)->dispose)
91     (*G_OBJECT_CLASS (g_tcp_server_parent_class)->dispose) (object);
92 }
93
94 static void
95 g_tcp_server_class_init (GTcpServerClass *klass)
96 {
97   GObjectClass *gobject_class G_GNUC_UNUSED = G_OBJECT_CLASS (klass);
98
99   g_type_class_add_private (klass, sizeof (GTcpServerPrivate));
100
101   gobject_class->finalize = g_tcp_server_finalize;
102   gobject_class->dispose = g_tcp_server_dispose;
103   gobject_class->set_property = g_tcp_server_set_property;
104   gobject_class->get_property = g_tcp_server_get_property;
105 }
106
107 static void
108 g_tcp_server_init (GTcpServer *server)
109 {
110   server->priv = G_TYPE_INSTANCE_GET_PRIVATE (server, G_TYPE_TCP_SERVER, GTcpServerPrivate);
111 }
112
113 GTcpServer *
114 g_tcp_server_new (GInetSocketAddress *address,
115                   GError **error)
116 {
117   return NULL;
118 }
119
120 GTcpClient *
121 g_tcp_server_accept (GTcpServer    *tcp_server,
122                      GCancellable  *cancellable,
123                      GError       **error)
124 {
125   return NULL;
126 }
127
128 void
129 g_tcp_server_close (GTcpServer *tcp_server)
130 {
131   g_return_if_fail (G_IS_TCP_SERVER (tcp_server));
132 }