6697a5f6e9f05ecce6668194556543ea81d6d161
[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
28 #include <string.h>
29 #include <errno.h>
30
31 #include "gtcpserver.h"
32
33 G_DEFINE_TYPE (GTcpServer, g_tcp_server, G_TYPE_OBJECT);
34
35 enum
36 {
37   PROP_0
38 };
39
40 struct _GTcpServerPrivate
41 {
42
43 };
44
45 static void
46 g_tcp_server_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
47 {
48   GTcpServer *server = G_TCP_SERVER (object);
49
50   switch (prop_id)
51     {
52       default:
53         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
54     }
55 }
56
57 static void
58 g_tcp_server_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
59 {
60   GTcpServer *server = G_TCP_SERVER (object);
61
62   switch (prop_id)
63     {
64       default:
65         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
66     }
67 }
68
69 static void
70 g_tcp_server_finalize (GObject *object)
71 {
72   GTcpServer *server = G_TCP_SERVER (object);
73
74   if (G_OBJECT_CLASS (g_tcp_server_parent_class)->finalize)
75     (*G_OBJECT_CLASS (g_tcp_server_parent_class)->finalize) (object);
76 }
77
78 static void
79 g_tcp_server_dispose (GObject *object)
80 {
81   GTcpServer *server = G_TCP_SERVER (object);
82
83   if (G_OBJECT_CLASS (g_tcp_server_parent_class)->dispose)
84     (*G_OBJECT_CLASS (g_tcp_server_parent_class)->dispose) (object);
85 }
86
87 static void
88 g_tcp_server_class_init (GTcpServerClass *klass)
89 {
90   GObjectClass *gobject_class G_GNUC_UNUSED = G_OBJECT_CLASS (klass);
91
92   g_type_class_add_private (klass, sizeof (GTcpServerPrivate));
93
94   gobject_class->finalize = g_tcp_server_finalize;
95   gobject_class->dispose = g_tcp_server_dispose;
96   gobject_class->set_property = g_tcp_server_set_property;
97   gobject_class->get_property = g_tcp_server_get_property;
98 }
99
100 static void
101 g_tcp_server_init (GTcpServer *server)
102 {
103   server->priv = G_TYPE_INSTANCE_GET_PRIVATE (server, G_TYPE_TCP_SERVER, GTcpServerPrivate);
104 }
105
106 GTcpServer *
107 g_tcp_server_new (GInetSocketAddress *address,
108                   GError **error)
109 {
110   return NULL;
111 }
112
113 GTcpClient *
114 g_tcp_server_accept (GTcpServer    *tcp_server,
115                      GCancellable  *cancellable,
116                      GError       **error)
117 {
118   return NULL;
119 }
120
121 void
122 g_tcp_server_close (GTcpServer *tcp_server)
123 {
124   g_return_if_fail (G_IS_TCP_SERVER (tcp_server));
125 }