author | Mikael Hallendal <micke@imendio.com> |
Wed, 09 Jul 2008 15:56:07 +0300 | |
changeset 433 | 2ed69f025f4a |
parent 432 | 63a049d146c3 |
child 434 | 579db9f99cc5 |
permissions | -rw-r--r-- |
432
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
1 |
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
2 |
/* |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
3 |
* Copyright (C) 2008 Imendio AB |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
4 |
* |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
6 |
* modify it under the terms of the GNU Lesser General Public License as |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; either version 2 of the |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
8 |
* License, or (at your option) any later version. |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
9 |
* |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
10 |
* This program is distributed in the hope that it will be useful, |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
13 |
* Lesser General Public License for more details. |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
14 |
* |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU Lesser General Public |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
16 |
* License along with this program; if not, write to the |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
17 |
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
18 |
* Boston, MA 02111-1307, USA. |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
19 |
*/ |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
20 |
|
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
21 |
#include <config.h> |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
22 |
|
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
23 |
#include "lm-socket.h" |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
24 |
|
433
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
25 |
static void socket_base_init (LmSocketIface *iface); |
432
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
26 |
|
433
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
27 |
GType |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
28 |
lm_socket_get_type (void) |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
29 |
{ |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
30 |
static GType iface_type = 0; |
432
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
31 |
|
433
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
32 |
if (!iface_type) { |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
33 |
static const GTypeInfo iface_info = { |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
34 |
sizeof (LmSocketIface), |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
35 |
(GBaseInitFunc) socket_base_init, |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
36 |
(GBaseFinalizeFunc) NULL, |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
37 |
}; |
432
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
38 |
|
433
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
39 |
iface_type = g_type_register_static (G_TYPE_INTERFACE, |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
40 |
"LmSocketIface", |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
41 |
&iface_info, |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
42 |
0); |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
43 |
|
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
44 |
g_type_interface_add_prerequisite (iface_type, G_TYPE_OBJECT); |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
45 |
} |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
46 |
|
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
47 |
return iface_type; |
432
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
48 |
} |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
49 |
|
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
50 |
static void |
433
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
51 |
socket_base_init (LmSocketIface *iface) |
432
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
52 |
{ |
433
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
53 |
static gboolean initialized = FALSE; |
432
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
54 |
|
433
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
55 |
if (!initialized) { |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
56 |
/* create interface signals here. */ |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
57 |
initialized = TRUE; |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
58 |
} |
432
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
59 |
} |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
60 |
|
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
61 |
LmSocket * |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
62 |
lm_socket_new (const gchar *host, guint port) |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
63 |
{ |
433
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
64 |
g_return_val_if_fail (host != NULL, NULL); |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
65 |
|
432
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
66 |
return NULL; |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
67 |
} |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
68 |
|
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
69 |
/* Use DNS lookup to find the port and the host */ |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
70 |
LmSocket * |
433
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
71 |
lm_socket_new_to_service (const gchar *service) |
432
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
72 |
{ |
433
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
73 |
g_return_val_if_fail (service != NULL, NULL); |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
74 |
|
432
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
75 |
return NULL; |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
76 |
} |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
77 |
|
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
78 |
void |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
79 |
lm_socket_connect (LmSocket *socket) |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
80 |
{ |
433
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
81 |
g_return_if_fail (LM_IS_SOCKET (socket)); |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
82 |
|
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
83 |
|
432
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
84 |
/* Initiate the connection process */ |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
85 |
/* DNS lookup, connect thing, create IOchannel etc */ |
433
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
86 |
if (!LM_SOCKET_GET_IFACE(socket)->write) { |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
87 |
g_assert_not_reached (); |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
88 |
} |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
89 |
|
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
90 |
LM_SOCKET_GET_IFACE(socket)->connect (socket); |
432
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
91 |
} |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
92 |
|
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
93 |
gboolean |
433
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
94 |
lm_socket_write (LmSocket *socket, gchar *buf, gsize len) |
432
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
95 |
{ |
433
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
96 |
g_return_val_if_fail (LM_IS_SOCKET (socket), FALSE); |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
97 |
g_return_val_if_fail (buf != NULL, FALSE); |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
98 |
|
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
99 |
if (!LM_SOCKET_GET_IFACE(socket)->write) { |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
100 |
g_assert_not_reached (); |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
101 |
} |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
102 |
|
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
103 |
return LM_SOCKET_GET_IFACE(socket)->write (socket, buf, len); |
432
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
104 |
} |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
105 |
|
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
106 |
gboolean |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
107 |
lm_socket_read (LmSocket *socket, |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
108 |
gchar *buf, |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
109 |
gsize buf_len, |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
110 |
gsize read_len) |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
111 |
{ |
433
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
112 |
g_return_val_if_fail (LM_IS_SOCKET (socket), FALSE); |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
113 |
g_return_val_if_fail (buf != NULL, FALSE); |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
114 |
|
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
115 |
if (!LM_SOCKET_GET_IFACE(socket)->read) { |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
116 |
g_assert_not_reached (); |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
117 |
} |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
118 |
|
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
119 |
return LM_SOCKET_GET_IFACE(socket)->read (socket, buf, buf_len, read_len); |
432
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
120 |
} |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
121 |
|
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
122 |
void |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
123 |
lm_socket_disconnect (LmSocket *socket) |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
124 |
{ |
433
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
125 |
g_return_if_fail (LM_IS_SOCKET (socket)); |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
126 |
|
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
127 |
if (!LM_SOCKET_GET_IFACE(socket)->disconnect) { |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
128 |
g_assert_not_reached (); |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
129 |
} |
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
130 |
|
2ed69f025f4a
Made LmSocket into an interface and hooked up implementation of it in LmTcpSocket.
Mikael Hallendal <micke@imendio.com>
parents:
432
diff
changeset
|
131 |
LM_SOCKET_GET_IFACE(socket)->disconnect (socket); |
432
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
132 |
} |
63a049d146c3
Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff
changeset
|
133 |