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> |
|
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 side about which handler will be called first of them. |
|
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: |
|
68 |
@LM_DISCONNECT_REASON_PING_TIME_OUT: Connection to the server pinged out. |
|
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 |
|
|
164 |
<!-- ##### FUNCTION lm_connection_is_authenticated ##### --> |
|
165 |
<para> |
|
166 |
|
|
167 |
</para> |
|
168 |
|
|
169 |
@connection: |
|
170 |
@Returns: |
|
171 |
|
|
172 |
|
|
173 |
<!-- ##### FUNCTION lm_connection_get_server ##### --> |
|
174 |
<para> |
|
175 |
|
|
176 |
</para> |
|
177 |
|
|
178 |
@connection: |
|
179 |
@Returns: |
|
180 |
|
|
181 |
|
|
182 |
<!-- ##### FUNCTION lm_connection_set_server ##### --> |
|
183 |
<para> |
|
184 |
|
|
185 |
</para> |
|
186 |
|
|
187 |
@connection: |
|
188 |
@server: |
|
189 |
|
|
190 |
|
|
191 |
<!-- ##### FUNCTION lm_connection_get_port ##### --> |
|
192 |
<para> |
|
193 |
|
|
194 |
</para> |
|
195 |
|
|
196 |
@connection: |
|
197 |
@Returns: |
|
198 |
|
|
199 |
|
|
200 |
<!-- ##### FUNCTION lm_connection_set_port ##### --> |
|
201 |
<para> |
|
202 |
|
|
203 |
</para> |
|
204 |
|
|
205 |
@connection: |
|
206 |
@port: |
|
207 |
|
|
208 |
|
|
209 |
<!-- ##### FUNCTION lm_connection_get_use_ssl ##### --> |
|
210 |
<para> |
|
211 |
|
|
212 |
</para> |
|
213 |
|
|
214 |
@connection: |
|
215 |
@Returns: |
|
216 |
|
|
217 |
|
|
218 |
<!-- ##### FUNCTION lm_connection_set_use_ssl ##### --> |
|
219 |
<para> |
|
220 |
|
|
221 |
</para> |
|
222 |
|
|
223 |
@connection: |
|
224 |
@use_ssl: |
|
225 |
|
|
226 |
|
|
227 |
<!-- ##### FUNCTION lm_connection_send ##### --> |
|
228 |
<para> |
|
229 |
|
|
230 |
</para> |
|
231 |
|
|
232 |
@connection: |
|
233 |
@message: |
|
234 |
@error: |
|
235 |
@Returns: |
|
236 |
|
|
237 |
|
|
238 |
<!-- ##### FUNCTION lm_connection_send_with_reply ##### --> |
|
239 |
<para> |
|
240 |
|
|
241 |
</para> |
|
242 |
|
|
243 |
@connection: |
|
244 |
@message: |
|
245 |
@handler: |
|
246 |
@error: |
|
247 |
@Returns: |
|
248 |
|
|
249 |
|
|
250 |
<!-- ##### FUNCTION lm_connection_send_with_reply_and_block ##### --> |
|
251 |
<para> |
|
252 |
|
|
253 |
</para> |
|
254 |
|
|
255 |
@connection: |
|
256 |
@message: |
|
257 |
@error: |
|
258 |
@Returns: |
|
259 |
|
|
260 |
|
|
261 |
<!-- ##### FUNCTION lm_connection_register_message_handler ##### --> |
|
262 |
<para> |
|
263 |
|
|
264 |
</para> |
|
265 |
|
|
266 |
@connection: |
|
267 |
@handler: |
|
268 |
@type: |
|
269 |
@priority: |
|
270 |
|
|
271 |
|
|
272 |
<!-- ##### FUNCTION lm_connection_unregister_message_handler ##### --> |
|
273 |
<para> |
|
274 |
|
|
275 |
</para> |
|
276 |
|
|
277 |
@connection: |
|
278 |
@handler: |
|
279 |
@type: |
|
280 |
|
|
281 |
|
|
282 |
<!-- ##### FUNCTION lm_connection_set_disconnect_function ##### --> |
|
283 |
<para> |
|
284 |
|
|
285 |
</para> |
|
286 |
|
|
287 |
@connection: |
|
288 |
@function: |
|
289 |
@user_data: |
|
290 |
@notify: |
|
291 |
|
|
292 |
|
|
293 |
<!-- ##### FUNCTION lm_connection_send_raw ##### --> |
|
294 |
<para> |
|
295 |
|
|
296 |
</para> |
|
297 |
|
|
298 |
@connection: |
|
299 |
@str: |
|
300 |
@error: |
|
301 |
@Returns: |
|
302 |
|
|
303 |
|
|
304 |
<!-- ##### FUNCTION lm_connection_ref ##### --> |
|
305 |
<para> |
|
306 |
|
|
307 |
</para> |
|
308 |
|
|
309 |
@connection: |
|
310 |
@Returns: |
|
311 |
|
|
312 |
|
|
313 |
<!-- ##### FUNCTION lm_connection_unref ##### --> |
|
314 |
<para> |
|
315 |
|
|
316 |
</para> |
|
317 |
|
|
318 |
@connection: |
|
319 |
|
|
320 |
|
|
321 |
y< |
|
322 |
|
|
323 |
|