File: prelude-connection-pool.sgml

package info (click to toggle)
libprelude 0.9.7.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 15,112 kB
  • ctags: 14,426
  • sloc: ansic: 131,701; xml: 27,964; sh: 9,465; makefile: 390; awk: 342; yacc: 207; lex: 141; python: 9; perl: 2
file content (282 lines) | stat: -rw-r--r-- 4,835 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<!-- ##### SECTION Title ##### -->
prelude-connection-pool

<!-- ##### SECTION Short_Description ##### -->

Pool of connection handling

<!-- ##### SECTION Long_Description ##### -->
<para>
This API handle pool of connection, allowing to address a set of connection using only one object.
</para>

<para>
AND &amp; OR of connection are supported, so that it is possible to
address several connection at once, or to only address a set of connection 
if another connection went down.
</para>

<para>
Additionally it provide failover in case one of the connection in
the pool goes down, and automatic reconnection and flushing of the
information that could not be sent due to the connection status.
</para>

<para>
It is usually not necessary to access this API directly, however if 
you are looking at how to read events from a pool of connection, you're most 
probably looking for the prelude_connection_pool_check_event() function.
</para>

<para>
If this is the case, use prelude_connection_pool_check_event() for polling the
pool or prelude_connection_set_event_handler() / prelude_connection_set_global_event_handler()
if you want asynchronous notification of event.
</para>

<para>
Note that prelude_connection_set_event_handler() and prelude_connection_set_global_event_handler()
are only asynchronous if timer are running in asynchronous mode. Otherwise, the callback for theses
function might be called when you call the prelude_timer_wake_up() function.
</para>

<para>
In the provided callback, you might use prelude_connection_recv() to retrieve an event of type
#PRELUDE_CONNECTION_POOL_EVENT_INPUT. And, you could, for example, if the retrieved message has
the #PRELUDE_MSG_ID_IDMEF tag, provide the returned #prelude_msg_t object to idmef_message_read() 
in order to convert the received message to a #idmef_message_t object.
</para>

<!-- ##### SECTION See_Also ##### -->
<para>
#prelude_connection_t
idmef_message_read()
</para>

<!-- ##### SECTION Stability_Level ##### -->


<!-- ##### ENUM prelude_connection_pool_flags_t ##### -->
<para>

</para>

@PRELUDE_CONNECTION_POOL_FLAGS_RECONNECT: 
@PRELUDE_CONNECTION_POOL_FLAGS_FAILOVER: 

<!-- ##### ENUM prelude_connection_pool_event_t ##### -->
<para>

</para>

@PRELUDE_CONNECTION_POOL_EVENT_INPUT: 
@PRELUDE_CONNECTION_POOL_EVENT_DEAD: 
@PRELUDE_CONNECTION_POOL_EVENT_ALIVE: 

<!-- ##### TYPEDEF prelude_connection_pool_t ##### -->
<para>

</para>


<!-- ##### FUNCTION prelude_connection_pool_broadcast ##### -->
<para>

</para>

@pool: 
@msg: 


<!-- ##### FUNCTION prelude_connection_pool_broadcast_async ##### -->
<para>

</para>

@pool: 
@msg: 


<!-- ##### FUNCTION prelude_connection_pool_init ##### -->
<para>

</para>

@pool: 
@Returns: 
<!-- # Unused Parameters # -->
@new: 


<!-- ##### FUNCTION prelude_connection_pool_new ##### -->
<para>

</para>

@ret: 
@cp: 
@permission: 
@Returns: 
<!-- # Unused Parameters # -->
@capability: 


<!-- ##### FUNCTION prelude_connection_pool_get_connection_list ##### -->
<para>

</para>

@pool: 
@Returns: 


<!-- ##### FUNCTION prelude_connection_pool_add_connection ##### -->
<para>

</para>

@pool: 
@cnx: 
@Returns: 


<!-- ##### FUNCTION prelude_connection_pool_set_connection_dead ##### -->
<para>

</para>

@pool: 
@cnx: 
@Returns: 


<!-- ##### FUNCTION prelude_connection_pool_set_connection_alive ##### -->
<para>

</para>

@pool: 
@cnx: 
@Returns: 


<!-- ##### FUNCTION prelude_connection_pool_set_connection_string ##### -->
<para>

</para>

@pool: 
@cfgstr: 
@Returns: 


<!-- ##### FUNCTION prelude_connection_pool_get_connection_string ##### -->
<para>

</para>

@pool: 
@Returns: 


<!-- ##### FUNCTION prelude_connection_pool_destroy ##### -->
<para>

</para>

@pool: 


<!-- ##### FUNCTION prelude_connection_pool_get_flags ##### -->
<para>

</para>

@pool: 
@Returns: 


<!-- ##### FUNCTION prelude_connection_pool_set_flags ##### -->
<para>

</para>

@pool: 
@flags: 


<!-- ##### FUNCTION prelude_connection_pool_set_required_permission ##### -->
<para>

</para>

@pool: 
@req_perm: 


<!-- ##### FUNCTION prelude_connection_pool_set_data ##### -->
<para>

</para>

@pool: 
@data: 


<!-- ##### FUNCTION prelude_connection_pool_get_data ##### -->
<para>

</para>

@pool: 
@Returns: 


<!-- ##### FUNCTION prelude_connection_pool_check_event ##### -->
<para>

</para>

@pool: 
@timeout: 
@event_cb: 
@extra: 
@Returns: 


<!-- ##### FUNCTION prelude_connection_pool_recv ##### -->
<para>

</para>

@pool: 
@timeout: 
@outconn: 
@outmsg: 
@Returns: 


<!-- ##### FUNCTION prelude_connection_pool_set_global_event_handler ##### -->
<para>

</para>

@pool: 
@wanted_events: 
@callback: 
<!-- # Unused Parameters # -->
@events: 


<!-- ##### FUNCTION prelude_connection_pool_set_event_handler ##### -->
<para>

</para>

@pool: 
@wanted_events: 
@callback: 
<!-- # Unused Parameters # -->
@events: