Debian Codegraph @

docs/api_reference/C/dbchannel_send_request.html

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <title>DB_CHANNEL-&gt;send_request()</title>
7 <link rel="stylesheet" href="apiReference.css" type="text/css" />
8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
9 <link rel="start" href="index.html" title="Berkeley DB C API Reference" />
10 <link rel="up" href="rep.html" title="Chapter 10.  Replication Methods" />
11 <link rel="prev" href="dbchannel_send_msg.html" title="DB_CHANNEL-&gt;send_msg()" />
12 <link rel="next" href="dbchannel_set_timeout.html" title="DB_CHANNEL-&gt;set_timeout()" />
13 </head>
14 <body>
15 <div xmlns="" class="navheader">
16 <div class="libver">
17 <p>Library Version 11.2.5.3</p>
18 </div>
19 <table width="100%" summary="Navigation header">
20 <tr>
21 <th colspan="3" align="center">DB_CHANNEL-&gt;send_request()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="dbchannel_send_msg.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 10. 
26 Replication Methods
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="dbchannel_set_timeout.html">Next</a></td>
29 </tr>
30 </table>
31 <hr />
32 </div>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
35 <div>
36 <div>
37 <h2 class="title" style="clear: both"><a id="dbchannel_send_request"></a>DB_CHANNEL-&gt;send_request()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db.h&gt;
42
43 int
44 DB_CHANNEL-&gt;send_request(DB_CHANNEL *channel, DBT *request,
45 u_int32_t nrequest, DBT *response,
46 db_timeout_t timeout, u_int32_t flags); </pre>
47 <p>
48 The <code class="methodname">DB_CHANNEL-&gt;send_request()</code> method
49 sends a message on the message channel. The message is sent
50 synchronously; the method blocks waiting for a response before
51 returning. If a response is not received within the timeout value
52 configured for this request, this method returns with an error
53 condition.
54 </p>
55 <p>
56 If you do not want to block while waiting for a response from a remote
57 site, use the
58 <a class="xref" href="dbchannel_send_msg.html" title="DB_CHANNEL-&gt;send_msg()">DB_CHANNEL-&gt;send_msg()</a>
59 method.
60 </p>
61 <p>
62 The message sent by this method is received and handled at
63 remote sites using a message dispatch callback, which is configured
64 using the <a class="xref" href="repmgr_msg_dispatch.html" title="DB_ENV-&gt;repmgr_msg_dispatch()">DB_ENV-&gt;repmgr_msg_dispatch()</a>
65 method.
66 </p>
67 <p>
68 The <code class="methodname">DB_CHANNEL-&gt;send_request()</code> <span>
69 <span>
70 method returns a non-zero error value on failure and 0 on success.
71 </span>
72
73 </span>
74 </p>
75 <div class="sect2" lang="en" xml:lang="en">
76 <div class="titlepage">
77 <div>
78 <div>
79 <h3 class="title"><a id="idp53870984"></a>Parameters</h3>
80 </div>
81 </div>
82 </div>
83 <div class="sect3" lang="en" xml:lang="en">
84 <div class="titlepage">
85 <div>
86 <div>
87 <h4 class="title"><a id="idp53870616"></a>request</h4>
88 </div>
89 </div>
90 </div>
91 <p>
92 Refers to an array of DBT handles. For more
93 information, see
94 <a class="xref" href="dbt.html" title="Chapter 4.  The DBT Handle">
95 The DBT Handle
96 </a>.
97 </p>
98 <p>
99 Any flags provided to the DBT handles used in this
100 array are ignored.
101 </p>
102 </div>
103 <div class="sect3" lang="en" xml:lang="en">
104 <div class="titlepage">
105 <div>
106 <div>
107 <h4 class="title"><a id="idp53865680"></a>nrequest</h4>
108 </div>
109 </div>
110 </div>
111 <p>
112 Indicates how many elements are contained in the
113 <code class="literal">msg</code> array.
114 </p>
115 </div>
116 <div class="sect3" lang="en" xml:lang="en">
117 <div class="titlepage">
118 <div>
119 <div>
120 <h4 class="title"><a id="idp53855328"></a>response</h4>
121 </div>
122 </div>
123 </div>
124 <p>
125 Points to a single DBT handle, which is used to
126 receive the response from the remote site. By default, the
127 response is expected to be a single-part message. If
128 there is a possibility that the response could be a
129 multi-part message, specify <code class="literal">DB_MULTIPLE</code>
130 to this method's <span class="bold"><strong>flags</strong></span>
131 parameter.
132 </p>
133 <p>
134 The response DBT should specify one of the
135 following flags:
136 <code class="literal">DB_DBT_MALLOC</code>, <code class="literal">DB_DBT_REALLOC</code>,
137 or <code class="literal">DB_DBT_USERMEM</code>.
138 </p>
139 <p>
140 For more information on configuring and using
141 DBTs, see
142 <a class="xref" href="dbt.html" title="Chapter 4.  The DBT Handle">
143 The DBT Handle
144 </a>.
145 </p>
146 <p>
147 Note that the response DBT can be empty. In this
148 way an application can send an acknowledgement even if
149 there is no other information that needs to be sent.
150 </p>
151 </div>
152 <div class="sect3" lang="en" xml:lang="en">
153 <div class="titlepage">
154 <div>
155 <div>
156 <h4 class="title"><a id="idp53858888"></a>timeout</h4>
157 </div>
158 </div>
159 </div>
160 <p>
161 Configures the amount of time that may elapse while this
162 method waits for a response from the remote site. If this
163 timeout period elapses without a response, this method
164 returns with an error condition.
165 </p>
166 <p>
167 The timeout value must be specified as an unsigned 32-bit
168 number of microseconds, limiting the maximum timeout to
169 roughly 71 minutes.
170 </p>
171 <p>
172 A timeout value of <code class="literal">0</code>
173 indicates that the channel's default timeout value should
174 be used. This default is configured using the
175 <a class="xref" href="dbchannel_set_timeout.html" title="DB_CHANNEL-&gt;set_timeout()">DB_CHANNEL-&gt;set_timeout()</a>
176 method.
177 </p>
178 </div>
179 <div class="sect3" lang="en" xml:lang="en">
180 <div class="titlepage">
181 <div>
182 <div>
183 <h4 class="title"><a id="idp53878992"></a>flags</h4>
184 </div>
185 </div>
186 </div>
187 <p>
188 This parameter must be set to either
189 <code class="literal">DB_MULTIPLE</code> or 0.
190 </p>
191 <p>
192 If there is a possibility that the response can consist of
193 multiple DBT handles, specify
194 <code class="literal">DB_MULTIPLE</code> to this parameter. In that
195 case, the response buffer is formatted for bulk
196 operations.
197 </p>
198 </div>
199 </div>
200 <div class="sect2" lang="en" xml:lang="en">
201 <div class="titlepage">
202 <div>
203 <div>
204 <h3 class="title"><a id="idp53880072"></a>Errors</h3>
205 </div>
206 </div>
207 </div>
208 <p>
209 The <code class="methodname">DB_CHANNEL-&gt;send_request()</code>
210 <span>
211 <span>
212 method may fail and return one of the following non-zero errors:
213 </span>
214
215 </span>
216 </p>
217 <div class="sect3" lang="en" xml:lang="en">
218 <div class="titlepage">
219 <div>
220 <div>
221 <h4 class="title"><a id="idp53884376"></a>DB_BUFFER_SMALL</h4>
222 </div>
223 </div>
224 </div>
225 <p>
226 <code class="literal">DB_MULTIPLE</code> was not specified for the
227 response DBT, but the remote site sent a response
228 consisting of more than one DBT; or a buffer
229 supplied using <code class="literal">DB_DBT_USERMEM</code>
230 was not large enough to contain the message response.
231 </p>
232 </div>
233 <div class="sect3" lang="en" xml:lang="en">
234 <div class="titlepage">
235 <div>
236 <div>
237 <h4 class="title"><a id="idp53885216"></a>DB_NOSERVER</h4>
238 </div>
239 </div>
240 </div>
241 <p>
242 A message was sent to a remote site that has not
243 configured a message dispatch call-back function.
244 Use the
245 <a class="xref" href="repmgr_msg_dispatch.html" title="DB_ENV-&gt;repmgr_msg_dispatch()">DB_ENV-&gt;repmgr_msg_dispatch()</a>
246 method at every site belonging to the replication group to configure a
247 message dispatch call-back function.
248 </p>
249 </div>
250 <div class="sect3" lang="en" xml:lang="en">
251 <div class="titlepage">
252 <div>
253 <div>
254 <h4 class="title"><a id="idp53856712"></a>EINVAL</h4>
255 </div>
256 </div>
257 </div>
258 <p>
259 If this method is called from a Base API application,
260 or if an invalid flag value or parameter was specified.
261 </p>
262 </div>
263 </div>
264 <div class="sect2" lang="en" xml:lang="en">
265 <div class="titlepage">
266 <div>
267 <div>
268 <h3 class="title"><a id="idp53886672"></a>Class</h3>
269 </div>
270 </div>
271 </div>
272 <p>
273 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a>
274 </p>
275 </div>
276 <div class="sect2" lang="en" xml:lang="en">
277 <div class="titlepage">
278 <div>
279 <div>
280 <h3 class="title"><a id="idp53870120"></a>See Also</h3>
281 </div>
282 </div>
283 </div>
284 <p>
285 <a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a>
286 </p>
287 </div>
288 </div>
289 <div class="navfooter">
290 <hr />
291 <table width="100%" summary="Navigation footer">
292 <tr>
293 <td width="40%" align="left"><a accesskey="p" href="dbchannel_send_msg.html">Prev</a> </td>
294 <td width="20%" align="center">
295 <a accesskey="u" href="rep.html">Up</a>
296 </td>
297 <td width="40%" align="right"> <a accesskey="n" href="dbchannel_set_timeout.html">Next</a></td>
298 </tr>
299 <tr>
300 <td width="40%" align="left" valign="top">DB_CHANNEL-&gt;send_msg() </td>
301 <td width="20%" align="center">
302 <a accesskey="h" href="index.html">Home</a>
303 </td>
304 <td width="40%" align="right" valign="top"> DB_CHANNEL-&gt;set_timeout()</td>
305 </tr>
306 </table>
307 </div>
308 </body>
309 </html>