1 /* GNIO - GLib Network Layer of GIO
3 * Copyright (C) 2008 Christian Kellner, Samuel Cormier-Iijima
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.
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.
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.
20 * Authors: Christian Kellner <gicmo@gnome.org>
21 * Samuel Cormier-Iijima <sciyoshi@gmail.com>
27 #include <gio/gasynchelper.h>
32 #include "ginetaddress.h"
33 #include "ginet4address.h"
34 #include "ginet6address.h"
36 #include "gtcpclient.h"
37 #include "gnioerror.h"
38 #include "ginetsocketaddress.h"
40 G_DEFINE_TYPE (GTcpClient, g_tcp_client, G_TYPE_OBJECT);
47 struct _GTcpClientPrivate
53 g_tcp_client_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
55 GTcpClient *client = G_TCP_CLIENT (object);
60 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
65 g_tcp_client_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
67 GTcpClient *client = G_TCP_CLIENT (object);
72 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
77 g_tcp_client_finalize (GObject *object)
79 GTcpClient *client = G_TCP_CLIENT (object);
81 if (G_OBJECT_CLASS (g_tcp_client_parent_class)->finalize)
82 (*G_OBJECT_CLASS (g_tcp_client_parent_class)->finalize) (object);
86 g_tcp_client_dispose (GObject *object)
88 GTcpClient *client = G_TCP_CLIENT (object);
90 if (G_OBJECT_CLASS (g_tcp_client_parent_class)->dispose)
91 (*G_OBJECT_CLASS (g_tcp_client_parent_class)->dispose) (object);
95 g_tcp_client_class_init (GTcpClientClass *klass)
97 GObjectClass *gobject_class G_GNUC_UNUSED = G_OBJECT_CLASS (klass);
99 g_type_class_add_private (klass, sizeof (GTcpClientPrivate));
101 gobject_class->finalize = g_tcp_client_finalize;
102 gobject_class->dispose = g_tcp_client_dispose;
103 gobject_class->set_property = g_tcp_client_set_property;
104 gobject_class->get_property = g_tcp_client_get_property;
108 g_tcp_client_init (GTcpClient *client)
110 client->priv = G_TYPE_INSTANCE_GET_PRIVATE (client, G_TYPE_TCP_CLIENT, GTcpClientPrivate);
114 g_tcp_client_new (GInetSocketAddress *address,
121 g_tcp_client_close (GTcpClient *tcp_client)
123 g_return_if_fail (G_IS_TCP_CLIENT (tcp_client));