author | hallski <hallski> |
Thu, 27 Nov 2003 21:12:51 +0000 | |
changeset 56 | 3bf928955fc5 |
parent 19 | bb3195f74ac7 |
child 57 | 6b168a8917f7 |
permissions | -rw-r--r-- |
1 | 1 |
<!-- ##### SECTION Title ##### --> |
2 |
LmConnection |
|
3 |
||
4 |
<!-- ##### SECTION Short_Description ##### --> |
|
5 |
A client connection to the server |
|
6 |
||
7 |
<!-- ##### SECTION Long_Description ##### --> |
|
8 |
<para> |
|
9 |
||
10 |
</para> |
|
11 |
||
12 |
<!-- ##### SECTION See_Also ##### --> |
|
13 |
<para> |
|
14 |
||
15 |
</para> |
|
16 |
||
17 |
<!-- ##### MACRO LM_CONNECTION ##### --> |
|
18 |
<para> |
|
19 |
Convenience macro used to cast a pointer to a #LmConnection. |
|
20 |
</para> |
|
21 |
||
22 |
@o: pointer to cast |
|
23 |
||
24 |
||
25 |
<!-- ##### MACRO LM_CONNECTION_DEFAULT_PORT ##### --> |
|
26 |
<para> |
|
27 |
Default jabber client port. |
|
28 |
</para> |
|
29 |
||
30 |
||
31 |
||
32 |
<!-- ##### MACRO LM_CONNECTION_DEFAULT_PORT_SSL ##### --> |
|
33 |
<para> |
|
34 |
Default jabber client port when using SSL encryption. |
|
35 |
</para> |
|
36 |
||
37 |
||
38 |
||
39 |
<!-- ##### STRUCT LmConnection ##### --> |
|
40 |
<para> |
|
41 |
This should not be accessed directly. Use the accessor functions as described below. |
|
42 |
</para> |
|
43 |
||
44 |
||
45 |
<!-- ##### ENUM LmHandlerResult ##### --> |
|
46 |
<para> |
|
47 |
The return type of an LmMessageHandler. This determines whether more message handlers should be called. |
|
48 |
</para> |
|
49 |
||
50 |
@LM_HANDLER_RESULT_REMOVE_MESSAGE: Stop calling message handlers. The message handler returning this declares the message has been handled and should be removed. |
|
51 |
@LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS: Return to continue the calling handlers from the handler list. This declares that another handlers should handle the message. |
|
52 |
||
53 |
<!-- ##### ENUM LmHandlerPriority ##### --> |
|
54 |
<para> |
|
56
3bf928955fc5
2003-11-20 Ross Burton <ross@burtonini.com>
hallski <hallski>
parents:
19
diff
changeset
|
55 |
Since the handlers decide whether to stop the calling chain with there return values it's sometimes decirable to be able to set priority. For example a handler that only logs all incoming messages and then pass the message on to another handler wants to have priority %LM_HANDLER_PRIORITY_FIRST. An handler that should take all messages that wasn't handled by anything else would want to have priority %LM_HANDLER_PRIORITY_LAST. If several handlers have the same priority nothing can be said about the order the handlers will be called in. |
1 | 56 |
</para> |
57 |
||
58 |
@LM_HANDLER_PRIORITY_LAST: Call the handler after all handlers with #NORMAL and #FIRST priority. |
|
59 |
@LM_HANDLER_PRIORITY_NORMAL: Called before handlers with priority #LAST and after those with #FIRST. |
|
60 |
@LM_HANDLER_PRIORITY_FIRST: These are called before all other handlers. |
|
61 |
||
62 |
<!-- ##### ENUM LmDisconnectReason ##### --> |
|
63 |
<para> |
|
64 |
Sent with #LmDisconnectFunction to describe why a connection was closed. |
|
65 |
</para> |
|
66 |
||
67 |
@LM_DISCONNECT_REASON_OK: |
|
56
3bf928955fc5
2003-11-20 Ross Burton <ross@burtonini.com>
hallski <hallski>
parents:
19
diff
changeset
|
68 |
@LM_DISCONNECT_REASON_PING_TIME_OUT: Connection to the server timed out. |
1 | 69 |
@LM_DISCONNECT_REASON_HUP: The socket emitted that the connection was hung up. |
70 |
@LM_DISCONNECT_REASON_ERROR: A generic error somewhere in the transport layer. |
|
71 |
@LM_DISCONNECT_REASON_UNKNOWN: An unknown error. |
|
72 |
||
73 |
<!-- ##### USER_FUNCTION LmResultFunction ##### --> |
|
74 |
<para> |
|
75 |
Callback for informing if an asynchronous operation was successful. |
|
76 |
</para> |
|
77 |
||
78 |
@connection: an #LmConnection |
|
79 |
@success: the result, %TRUE if operation succeeded, otherwise %FALSE |
|
80 |
@user_data: User data passed when function being called. |
|
81 |
||
82 |
||
83 |
<!-- ##### USER_FUNCTION LmDisconnectFunction ##### --> |
|
84 |
<para> |
|
85 |
Callback called when a connection is closed. |
|
86 |
</para> |
|
87 |
||
88 |
@connection: an #LmConnection |
|
89 |
@reason: the reason the connection was closed. |
|
90 |
@user_data: User data passed when function being called. |
|
91 |
||
92 |
||
93 |
<!-- ##### FUNCTION lm_connection_new ##### --> |
|
94 |
<para> |
|
95 |
||
96 |
</para> |
|
97 |
||
98 |
@server: |
|
99 |
@Returns: |
|
100 |
||
101 |
||
102 |
<!-- ##### FUNCTION lm_connection_open ##### --> |
|
103 |
<para> |
|
104 |
||
105 |
</para> |
|
106 |
||
107 |
@connection: |
|
108 |
@function: |
|
109 |
@user_data: |
|
110 |
@notify: |
|
111 |
@error: |
|
112 |
@Returns: |
|
113 |
||
114 |
||
115 |
<!-- ##### FUNCTION lm_connection_open_and_block ##### --> |
|
116 |
<para> |
|
117 |
||
118 |
</para> |
|
119 |
||
120 |
@connection: |
|
121 |
@error: |
|
122 |
@Returns: |
|
123 |
||
124 |
||
125 |
<!-- ##### FUNCTION lm_connection_close ##### --> |
|
126 |
<para> |
|
127 |
||
128 |
</para> |
|
129 |
||
130 |
@connection: |
|
131 |
@error: |
|
132 |
@Returns: |
|
133 |
||
134 |
||
135 |
<!-- ##### FUNCTION lm_connection_authenticate ##### --> |
|
136 |
<para> |
|
137 |
||
138 |
</para> |
|
139 |
||
140 |
@connection: |
|
141 |
@username: |
|
142 |
@password: |
|
143 |
@resource: |
|
144 |
@function: |
|
145 |
@user_data: |
|
146 |
@notify: |
|
147 |
@error: |
|
148 |
@Returns: |
|
149 |
||
150 |
||
151 |
<!-- ##### FUNCTION lm_connection_authenticate_and_block ##### --> |
|
152 |
<para> |
|
153 |
||
154 |
</para> |
|
155 |
||
156 |
@connection: |
|
157 |
@username: |
|
158 |
@password: |
|
159 |
@resource: |
|
160 |
@error: |
|
161 |
@Returns: |
|
162 |
||
163 |
||
19
bb3195f74ac7
2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
1
diff
changeset
|
164 |
<!-- ##### FUNCTION lm_connection_is_open ##### --> |
bb3195f74ac7
2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
1
diff
changeset
|
165 |
<para> |
bb3195f74ac7
2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
1
diff
changeset
|
166 |
|
bb3195f74ac7
2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
1
diff
changeset
|
167 |
</para> |
bb3195f74ac7
2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
1
diff
changeset
|
168 |
|
bb3195f74ac7
2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
1
diff
changeset
|
169 |
@connection: |
bb3195f74ac7
2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
1
diff
changeset
|
170 |
@Returns: |
bb3195f74ac7
2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
1
diff
changeset
|
171 |
|
bb3195f74ac7
2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
1
diff
changeset
|
172 |
|
1 | 173 |
<!-- ##### FUNCTION lm_connection_is_authenticated ##### --> |
174 |
<para> |
|
175 |
||
176 |
</para> |
|
177 |
||
178 |
@connection: |
|
179 |
@Returns: |
|
180 |
||
181 |
||
182 |
<!-- ##### FUNCTION lm_connection_get_server ##### --> |
|
183 |
<para> |
|
184 |
||
185 |
</para> |
|
186 |
||
187 |
@connection: |
|
188 |
@Returns: |
|
189 |
||
190 |
||
191 |
<!-- ##### FUNCTION lm_connection_set_server ##### --> |
|
192 |
<para> |
|
193 |
||
194 |
</para> |
|
195 |
||
196 |
@connection: |
|
197 |
@server: |
|
198 |
||
199 |
||
200 |
<!-- ##### FUNCTION lm_connection_get_port ##### --> |
|
201 |
<para> |
|
202 |
||
203 |
</para> |
|
204 |
||
205 |
@connection: |
|
206 |
@Returns: |
|
207 |
||
208 |
||
209 |
<!-- ##### FUNCTION lm_connection_set_port ##### --> |
|
210 |
<para> |
|
211 |
||
212 |
</para> |
|
213 |
||
214 |
@connection: |
|
215 |
@port: |
|
216 |
||
217 |
||
19
bb3195f74ac7
2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
1
diff
changeset
|
218 |
<!-- ##### FUNCTION lm_connection_supports_ssl ##### --> |
bb3195f74ac7
2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
1
diff
changeset
|
219 |
<para> |
bb3195f74ac7
2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
1
diff
changeset
|
220 |
|
bb3195f74ac7
2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
1
diff
changeset
|
221 |
</para> |
bb3195f74ac7
2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
1
diff
changeset
|
222 |
|
bb3195f74ac7
2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
1
diff
changeset
|
223 |
@Returns: |
bb3195f74ac7
2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
1
diff
changeset
|
224 |
|
bb3195f74ac7
2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
1
diff
changeset
|
225 |
|
1 | 226 |
<!-- ##### FUNCTION lm_connection_get_use_ssl ##### --> |
227 |
<para> |
|
228 |
||
229 |
</para> |
|
230 |
||
231 |
@connection: |
|
232 |
@Returns: |
|
233 |
||
234 |
||
235 |
<!-- ##### FUNCTION lm_connection_set_use_ssl ##### --> |
|
236 |
<para> |
|
237 |
||
238 |
</para> |
|
239 |
||
240 |
@connection: |
|
241 |
@use_ssl: |
|
242 |
||
243 |
||
244 |
<!-- ##### FUNCTION lm_connection_send ##### --> |
|
245 |
<para> |
|
246 |
||
247 |
</para> |
|
248 |
||
249 |
@connection: |
|
250 |
@message: |
|
251 |
@error: |
|
252 |
@Returns: |
|
253 |
||
254 |
||
255 |
<!-- ##### FUNCTION lm_connection_send_with_reply ##### --> |
|
256 |
<para> |
|
257 |
||
258 |
</para> |
|
259 |
||
260 |
@connection: |
|
261 |
@message: |
|
262 |
@handler: |
|
263 |
@error: |
|
264 |
@Returns: |
|
265 |
||
266 |
||
267 |
<!-- ##### FUNCTION lm_connection_send_with_reply_and_block ##### --> |
|
268 |
<para> |
|
269 |
||
270 |
</para> |
|
271 |
||
272 |
@connection: |
|
273 |
@message: |
|
274 |
@error: |
|
275 |
@Returns: |
|
276 |
||
277 |
||
278 |
<!-- ##### FUNCTION lm_connection_register_message_handler ##### --> |
|
279 |
<para> |
|
280 |
||
281 |
</para> |
|
282 |
||
283 |
@connection: |
|
284 |
@handler: |
|
285 |
@type: |
|
286 |
@priority: |
|
287 |
||
288 |
||
289 |
<!-- ##### FUNCTION lm_connection_unregister_message_handler ##### --> |
|
290 |
<para> |
|
291 |
||
292 |
</para> |
|
293 |
||
294 |
@connection: |
|
295 |
@handler: |
|
296 |
@type: |
|
297 |
||
298 |
||
299 |
<!-- ##### FUNCTION lm_connection_set_disconnect_function ##### --> |
|
300 |
<para> |
|
301 |
||
302 |
</para> |
|
303 |
||
304 |
@connection: |
|
305 |
@function: |
|
306 |
@user_data: |
|
307 |
@notify: |
|
308 |
||
309 |
||
310 |
<!-- ##### FUNCTION lm_connection_send_raw ##### --> |
|
311 |
<para> |
|
312 |
||
313 |
</para> |
|
314 |
||
315 |
@connection: |
|
316 |
@str: |
|
317 |
@error: |
|
318 |
@Returns: |
|
319 |
||
320 |
||
321 |
<!-- ##### FUNCTION lm_connection_ref ##### --> |
|
322 |
<para> |
|
323 |
||
324 |
</para> |
|
325 |
||
326 |
@connection: |
|
327 |
@Returns: |
|
328 |
||
329 |
||
330 |
<!-- ##### FUNCTION lm_connection_unref ##### --> |
|
331 |
<para> |
|
332 |
||
333 |
</para> |
|
334 |
||
335 |
@connection: |
|
336 |
||
337 |
||
338 |
y< |
|
339 |
||
340 |