~ubuntu-branches/ubuntu/trusty/ocamlnet/trusty

« back to all changes in this revision

Viewing changes to doc/html-main/Rpc_proxy.ManagedClient.html

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu
  • Date: 2011-09-02 14:12:33 UTC
  • mfrom: (18.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110902141233-zbj0ygxb92u6gy4z
Tags: 3.4-1
* New upstream release
  - add a new NetcgiRequire directive to ease dependency management
    (Closes: #637147)
  - remove patches that were applied upstream:
    + Added-missing-shebang-lines-in-example-shell-scripts
    + Try-also-ocamlc-for-POSIX-threads

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
2
<html>
 
3
<head>
 
4
<link rel="stylesheet" href="style.css" type="text/css">
 
5
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
 
6
<link rel="Start" href="index.html">
 
7
<link rel="previous" href="Rpc_proxy.ReliabilityCache.html">
 
8
<link rel="next" href="Rpc_proxy.ManagedSet.html">
 
9
<link rel="Up" href="Rpc_proxy.html">
 
10
<link title="Index of types" rel=Appendix href="index_types.html">
 
11
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
 
12
<link title="Index of values" rel=Appendix href="index_values.html">
 
13
<link title="Index of class attributes" rel=Appendix href="index_attributes.html">
 
14
<link title="Index of class methods" rel=Appendix href="index_methods.html">
 
15
<link title="Index of classes" rel=Appendix href="index_classes.html">
 
16
<link title="Index of class types" rel=Appendix href="index_class_types.html">
 
17
<link title="Index of modules" rel=Appendix href="index_modules.html">
 
18
<link title="Index of module types" rel=Appendix href="index_module_types.html">
 
19
<link title="Uq_gtk" rel="Chapter" href="Uq_gtk.html">
 
20
<link title="Uq_ssl" rel="Chapter" href="Uq_ssl.html">
 
21
<link title="Https_client" rel="Chapter" href="Https_client.html">
 
22
<link title="Uq_tcl" rel="Chapter" href="Uq_tcl.html">
 
23
<link title="Equeue" rel="Chapter" href="Equeue.html">
 
24
<link title="Unixqueue" rel="Chapter" href="Unixqueue.html">
 
25
<link title="Unixqueue_pollset" rel="Chapter" href="Unixqueue_pollset.html">
 
26
<link title="Unixqueue_select" rel="Chapter" href="Unixqueue_select.html">
 
27
<link title="Uq_resolver" rel="Chapter" href="Uq_resolver.html">
 
28
<link title="Uq_engines" rel="Chapter" href="Uq_engines.html">
 
29
<link title="Uq_socks5" rel="Chapter" href="Uq_socks5.html">
 
30
<link title="Uq_io" rel="Chapter" href="Uq_io.html">
 
31
<link title="Uq_lwt" rel="Chapter" href="Uq_lwt.html">
 
32
<link title="Uq_libevent" rel="Chapter" href="Uq_libevent.html">
 
33
<link title="Equeue_intro" rel="Chapter" href="Equeue_intro.html">
 
34
<link title="Netcamlbox" rel="Chapter" href="Netcamlbox.html">
 
35
<link title="Netcgi_apache" rel="Chapter" href="Netcgi_apache.html">
 
36
<link title="Netcgi_modtpl" rel="Chapter" href="Netcgi_modtpl.html">
 
37
<link title="Netcgi_plex" rel="Chapter" href="Netcgi_plex.html">
 
38
<link title="Netcgi_common" rel="Chapter" href="Netcgi_common.html">
 
39
<link title="Netcgi" rel="Chapter" href="Netcgi.html">
 
40
<link title="Netcgi_ajp" rel="Chapter" href="Netcgi_ajp.html">
 
41
<link title="Netcgi_scgi" rel="Chapter" href="Netcgi_scgi.html">
 
42
<link title="Netcgi_cgi" rel="Chapter" href="Netcgi_cgi.html">
 
43
<link title="Netcgi_fcgi" rel="Chapter" href="Netcgi_fcgi.html">
 
44
<link title="Netcgi_dbi" rel="Chapter" href="Netcgi_dbi.html">
 
45
<link title="Netcgi1_compat" rel="Chapter" href="Netcgi1_compat.html">
 
46
<link title="Netcgi_test" rel="Chapter" href="Netcgi_test.html">
 
47
<link title="Netcgi_porting" rel="Chapter" href="Netcgi_porting.html">
 
48
<link title="Http_client_conncache" rel="Chapter" href="Http_client_conncache.html">
 
49
<link title="Http_client" rel="Chapter" href="Http_client.html">
 
50
<link title="Telnet_client" rel="Chapter" href="Telnet_client.html">
 
51
<link title="Ftp_data_endpoint" rel="Chapter" href="Ftp_data_endpoint.html">
 
52
<link title="Ftp_client" rel="Chapter" href="Ftp_client.html">
 
53
<link title="Http_fs" rel="Chapter" href="Http_fs.html">
 
54
<link title="Ftp_fs" rel="Chapter" href="Ftp_fs.html">
 
55
<link title="Netclient_tut" rel="Chapter" href="Netclient_tut.html">
 
56
<link title="Netgssapi" rel="Chapter" href="Netgssapi.html">
 
57
<link title="Nethttpd_types" rel="Chapter" href="Nethttpd_types.html">
 
58
<link title="Nethttpd_kernel" rel="Chapter" href="Nethttpd_kernel.html">
 
59
<link title="Nethttpd_reactor" rel="Chapter" href="Nethttpd_reactor.html">
 
60
<link title="Nethttpd_engine" rel="Chapter" href="Nethttpd_engine.html">
 
61
<link title="Nethttpd_services" rel="Chapter" href="Nethttpd_services.html">
 
62
<link title="Nethttpd_plex" rel="Chapter" href="Nethttpd_plex.html">
 
63
<link title="Nethttpd_util" rel="Chapter" href="Nethttpd_util.html">
 
64
<link title="Nethttpd_intro" rel="Chapter" href="Nethttpd_intro.html">
 
65
<link title="Netmech_scram" rel="Chapter" href="Netmech_scram.html">
 
66
<link title="Netmech_scram_gssapi" rel="Chapter" href="Netmech_scram_gssapi.html">
 
67
<link title="Netmcore" rel="Chapter" href="Netmcore.html">
 
68
<link title="Netmcore_camlbox" rel="Chapter" href="Netmcore_camlbox.html">
 
69
<link title="Netmcore_mempool" rel="Chapter" href="Netmcore_mempool.html">
 
70
<link title="Netmcore_heap" rel="Chapter" href="Netmcore_heap.html">
 
71
<link title="Netmcore_ref" rel="Chapter" href="Netmcore_ref.html">
 
72
<link title="Netmcore_array" rel="Chapter" href="Netmcore_array.html">
 
73
<link title="Netmcore_sem" rel="Chapter" href="Netmcore_sem.html">
 
74
<link title="Netmcore_mutex" rel="Chapter" href="Netmcore_mutex.html">
 
75
<link title="Netmcore_condition" rel="Chapter" href="Netmcore_condition.html">
 
76
<link title="Netmcore_queue" rel="Chapter" href="Netmcore_queue.html">
 
77
<link title="Netmcore_buffer" rel="Chapter" href="Netmcore_buffer.html">
 
78
<link title="Netmcore_matrix" rel="Chapter" href="Netmcore_matrix.html">
 
79
<link title="Netmcore_hashtbl" rel="Chapter" href="Netmcore_hashtbl.html">
 
80
<link title="Netmcore_process" rel="Chapter" href="Netmcore_process.html">
 
81
<link title="Netmcore_tut" rel="Chapter" href="Netmcore_tut.html">
 
82
<link title="Netplex_types" rel="Chapter" href="Netplex_types.html">
 
83
<link title="Netplex_mp" rel="Chapter" href="Netplex_mp.html">
 
84
<link title="Netplex_mt" rel="Chapter" href="Netplex_mt.html">
 
85
<link title="Netplex_log" rel="Chapter" href="Netplex_log.html">
 
86
<link title="Netplex_controller" rel="Chapter" href="Netplex_controller.html">
 
87
<link title="Netplex_container" rel="Chapter" href="Netplex_container.html">
 
88
<link title="Netplex_sockserv" rel="Chapter" href="Netplex_sockserv.html">
 
89
<link title="Netplex_workload" rel="Chapter" href="Netplex_workload.html">
 
90
<link title="Netplex_main" rel="Chapter" href="Netplex_main.html">
 
91
<link title="Netplex_config" rel="Chapter" href="Netplex_config.html">
 
92
<link title="Netplex_kit" rel="Chapter" href="Netplex_kit.html">
 
93
<link title="Rpc_netplex" rel="Chapter" href="Rpc_netplex.html">
 
94
<link title="Netplex_cenv" rel="Chapter" href="Netplex_cenv.html">
 
95
<link title="Netplex_semaphore" rel="Chapter" href="Netplex_semaphore.html">
 
96
<link title="Netplex_sharedvar" rel="Chapter" href="Netplex_sharedvar.html">
 
97
<link title="Netplex_mutex" rel="Chapter" href="Netplex_mutex.html">
 
98
<link title="Netplex_encap" rel="Chapter" href="Netplex_encap.html">
 
99
<link title="Netplex_intro" rel="Chapter" href="Netplex_intro.html">
 
100
<link title="Netplex_advanced" rel="Chapter" href="Netplex_advanced.html">
 
101
<link title="Netplex_admin" rel="Chapter" href="Netplex_admin.html">
 
102
<link title="Netshm" rel="Chapter" href="Netshm.html">
 
103
<link title="Netshm_data" rel="Chapter" href="Netshm_data.html">
 
104
<link title="Netshm_hashtbl" rel="Chapter" href="Netshm_hashtbl.html">
 
105
<link title="Netshm_array" rel="Chapter" href="Netshm_array.html">
 
106
<link title="Netshm_intro" rel="Chapter" href="Netshm_intro.html">
 
107
<link title="Netconversion" rel="Chapter" href="Netconversion.html">
 
108
<link title="Netchannels" rel="Chapter" href="Netchannels.html">
 
109
<link title="Netstream" rel="Chapter" href="Netstream.html">
 
110
<link title="Mimestring" rel="Chapter" href="Mimestring.html">
 
111
<link title="Netmime" rel="Chapter" href="Netmime.html">
 
112
<link title="Netsendmail" rel="Chapter" href="Netsendmail.html">
 
113
<link title="Neturl" rel="Chapter" href="Neturl.html">
 
114
<link title="Netaddress" rel="Chapter" href="Netaddress.html">
 
115
<link title="Netbuffer" rel="Chapter" href="Netbuffer.html">
 
116
<link title="Netdate" rel="Chapter" href="Netdate.html">
 
117
<link title="Netencoding" rel="Chapter" href="Netencoding.html">
 
118
<link title="Netulex" rel="Chapter" href="Netulex.html">
 
119
<link title="Netaccel" rel="Chapter" href="Netaccel.html">
 
120
<link title="Netaccel_link" rel="Chapter" href="Netaccel_link.html">
 
121
<link title="Nethtml" rel="Chapter" href="Nethtml.html">
 
122
<link title="Netstring_str" rel="Chapter" href="Netstring_str.html">
 
123
<link title="Netstring_pcre" rel="Chapter" href="Netstring_pcre.html">
 
124
<link title="Netmappings" rel="Chapter" href="Netmappings.html">
 
125
<link title="Netaux" rel="Chapter" href="Netaux.html">
 
126
<link title="Nethttp" rel="Chapter" href="Nethttp.html">
 
127
<link title="Netpagebuffer" rel="Chapter" href="Netpagebuffer.html">
 
128
<link title="Netfs" rel="Chapter" href="Netfs.html">
 
129
<link title="Netglob" rel="Chapter" href="Netglob.html">
 
130
<link title="Netauth" rel="Chapter" href="Netauth.html">
 
131
<link title="Netsockaddr" rel="Chapter" href="Netsockaddr.html">
 
132
<link title="Netnumber" rel="Chapter" href="Netnumber.html">
 
133
<link title="Rtypes" rel="Chapter" href="Rtypes.html">
 
134
<link title="Xdr_mstring" rel="Chapter" href="Xdr_mstring.html">
 
135
<link title="Xdr" rel="Chapter" href="Xdr.html">
 
136
<link title="Netcompression" rel="Chapter" href="Netcompression.html">
 
137
<link title="Netchannels_tut" rel="Chapter" href="Netchannels_tut.html">
 
138
<link title="Netmime_tut" rel="Chapter" href="Netmime_tut.html">
 
139
<link title="Netsendmail_tut" rel="Chapter" href="Netsendmail_tut.html">
 
140
<link title="Netulex_tut" rel="Chapter" href="Netulex_tut.html">
 
141
<link title="Neturl_tut" rel="Chapter" href="Neturl_tut.html">
 
142
<link title="Netsys" rel="Chapter" href="Netsys.html">
 
143
<link title="Netsys_posix" rel="Chapter" href="Netsys_posix.html">
 
144
<link title="Netsys_pollset" rel="Chapter" href="Netsys_pollset.html">
 
145
<link title="Netlog" rel="Chapter" href="Netlog.html">
 
146
<link title="Netexn" rel="Chapter" href="Netexn.html">
 
147
<link title="Netsys_win32" rel="Chapter" href="Netsys_win32.html">
 
148
<link title="Netsys_pollset_posix" rel="Chapter" href="Netsys_pollset_posix.html">
 
149
<link title="Netsys_pollset_win32" rel="Chapter" href="Netsys_pollset_win32.html">
 
150
<link title="Netsys_pollset_generic" rel="Chapter" href="Netsys_pollset_generic.html">
 
151
<link title="Netsys_signal" rel="Chapter" href="Netsys_signal.html">
 
152
<link title="Netsys_oothr" rel="Chapter" href="Netsys_oothr.html">
 
153
<link title="Netsys_xdr" rel="Chapter" href="Netsys_xdr.html">
 
154
<link title="Netsys_rng" rel="Chapter" href="Netsys_rng.html">
 
155
<link title="Netsys_types" rel="Chapter" href="Netsys_types.html">
 
156
<link title="Netsys_mem" rel="Chapter" href="Netsys_mem.html">
 
157
<link title="Netsys_tmp" rel="Chapter" href="Netsys_tmp.html">
 
158
<link title="Netgzip" rel="Chapter" href="Netgzip.html">
 
159
<link title="Netpop" rel="Chapter" href="Netpop.html">
 
160
<link title="Rpc_auth_dh" rel="Chapter" href="Rpc_auth_dh.html">
 
161
<link title="Rpc_key_service" rel="Chapter" href="Rpc_key_service.html">
 
162
<link title="Rpc_time" rel="Chapter" href="Rpc_time.html">
 
163
<link title="Rpc_auth_local" rel="Chapter" href="Rpc_auth_local.html">
 
164
<link title="Rpc_ssl" rel="Chapter" href="Rpc_ssl.html">
 
165
<link title="Rpc_xti_client" rel="Chapter" href="Rpc_xti_client.html">
 
166
<link title="Rpc" rel="Chapter" href="Rpc.html">
 
167
<link title="Rpc_program" rel="Chapter" href="Rpc_program.html">
 
168
<link title="Rpc_util" rel="Chapter" href="Rpc_util.html">
 
169
<link title="Rpc_portmapper_aux" rel="Chapter" href="Rpc_portmapper_aux.html">
 
170
<link title="Rpc_packer" rel="Chapter" href="Rpc_packer.html">
 
171
<link title="Rpc_transport" rel="Chapter" href="Rpc_transport.html">
 
172
<link title="Rpc_client" rel="Chapter" href="Rpc_client.html">
 
173
<link title="Rpc_simple_client" rel="Chapter" href="Rpc_simple_client.html">
 
174
<link title="Rpc_portmapper_clnt" rel="Chapter" href="Rpc_portmapper_clnt.html">
 
175
<link title="Rpc_portmapper" rel="Chapter" href="Rpc_portmapper.html">
 
176
<link title="Rpc_server" rel="Chapter" href="Rpc_server.html">
 
177
<link title="Rpc_auth_sys" rel="Chapter" href="Rpc_auth_sys.html">
 
178
<link title="Rpc_auth_gssapi" rel="Chapter" href="Rpc_auth_gssapi.html">
 
179
<link title="Rpc_proxy" rel="Chapter" href="Rpc_proxy.html">
 
180
<link title="Rpc_intro" rel="Chapter" href="Rpc_intro.html">
 
181
<link title="Rpc_mapping_ref" rel="Chapter" href="Rpc_mapping_ref.html">
 
182
<link title="Rpc_intro_gss" rel="Chapter" href="Rpc_intro_gss.html">
 
183
<link title="Shell_sys" rel="Chapter" href="Shell_sys.html">
 
184
<link title="Shell" rel="Chapter" href="Shell.html">
 
185
<link title="Shell_uq" rel="Chapter" href="Shell_uq.html">
 
186
<link title="Shell_fs" rel="Chapter" href="Shell_fs.html">
 
187
<link title="Shell_intro" rel="Chapter" href="Shell_intro.html">
 
188
<link title="Netsmtp" rel="Chapter" href="Netsmtp.html">
 
189
<link title="Intro" rel="Chapter" href="Intro.html">
 
190
<link title="Platform" rel="Chapter" href="Platform.html">
 
191
<link title="Foreword" rel="Chapter" href="Foreword.html">
 
192
<link title="Ipv6" rel="Chapter" href="Ipv6.html"><title>Ocamlnet 3 Reference Manual : Rpc_proxy.ManagedClient</title>
 
193
</head>
 
194
<body>
 
195
<div class="navbar"><a href="Rpc_proxy.ReliabilityCache.html">Previous</a>
 
196
&nbsp;<a href="Rpc_proxy.html">Up</a>
 
197
&nbsp;<a href="Rpc_proxy.ManagedSet.html">Next</a>
 
198
</div>
 
199
<center><h1>Module <a href="type_Rpc_proxy.ManagedClient.html">Rpc_proxy.ManagedClient</a></h1></center>
 
200
<br>
 
201
<pre><span class="keyword">module</span> ManagedClient: <code class="code">sig</code> <a href="Rpc_proxy.ManagedClient.html">..</a> <code class="code">end</code></pre><hr width="100%">
 
202
<br>
 
203
Managed clients are <a href="Rpc_client.html"><code class="code">Rpc_client</code></a> clients with the ability to
 
204
      reconnect in the case of errors. 
 
205
<p>
 
206
 
 
207
      Additional features:<ul>
 
208
<li>they can also be disabled, either based on a  time criterion or
 
209
         a customizable hook. This encodes the assumption that failing
 
210
         servers need some time to recover</li>
 
211
<li>unused connections are closed (driven by a timeout)</li>
 
212
<li>support for the initial ping after establishing the connection</li>
 
213
</ul>
 
214
 
 
215
      Initial pings are useful to test whether the connection is
 
216
      really working. Servers normally accept new TCP connections without
 
217
      knowing whether there are resources for processing the connections
 
218
      (i.e. whether there is a process or thread waiting for serving
 
219
      it). Because of this, the client cannot assume that the TCP
 
220
      connection is really up only because the <code class="code">connect</code> system call
 
221
      said the connection is there. The initial ping fixes this problem:
 
222
      The null procedure is once called after the TCP connection has
 
223
      been established. Only when this works the client believes the
 
224
      connection is really up. It is required that <code class="code">mclient_programs</code>
 
225
      is configured with at least one program, and this program must
 
226
      have a procedure number 0 of type <code class="code">void -&gt; void</code>.
 
227
<p>
 
228
 
 
229
      In multi-threaded programs, threads must not share managed clients.
 
230
<p>
 
231
 
 
232
      Managed clients can be used together with ocamlrpcgen-generated
 
233
      modules. Provided the generated module <code class="code">M_clnt</code> contains the
 
234
      client code for program <code class="code">P</code> and version <code class="code">V</code>, one can do
 
235
<p>
 
236
 
 
237
      <pre><code class="code">         module MC = M_clnt.Make'P(Rpc_proxy.ManagedClient)
 
238
      </code></pre>
 
239
<p>
 
240
 
 
241
      and call RPCs <code class="code">f</code> as in
 
242
<p>
 
243
 
 
244
      <pre><code class="code">         let res = MC.V.f mc arg
 
245
      </code></pre>
 
246
<p>
 
247
 
 
248
      (if <code class="code">mc</code> is the managed client, and <code class="code">arg</code> the argument).<br>
 
249
<pre><span id="TYPEmclient"><span class="keyword">type</span> <code class="type"></code>mclient</span> </pre>
 
250
<div class="info">
 
251
A managed client<br>
 
252
</div>
 
253
 
 
254
<br><code><span id="TYPEmclient_config"><span class="keyword">type</span> <code class="type"></code>mclient_config</span> = {</code><table class="typetable">
 
255
<tr>
 
256
<td align="left" valign="top" >
 
257
<code>&nbsp;&nbsp;</code></td>
 
258
<td align="left" valign="top" >
 
259
<code>mclient_rcache&nbsp;: <code class="type"><a href="Rpc_proxy.ReliabilityCache.html#TYPErcache">Rpc_proxy.ReliabilityCache.rcache</a></code>;</code></td>
 
260
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The rcache</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
 
261
</tr>
 
262
<tr>
 
263
<td align="left" valign="top" >
 
264
<code>&nbsp;&nbsp;</code></td>
 
265
<td align="left" valign="top" >
 
266
<code>mclient_socket_config&nbsp;: <code class="type"><a href="Rpc_client.socket_config-c.html">Rpc_client.socket_config</a></code>;</code></td>
 
267
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The socket configuration</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
 
268
</tr>
 
269
<tr>
 
270
<td align="left" valign="top" >
 
271
<code>&nbsp;&nbsp;</code></td>
 
272
<td align="left" valign="top" >
 
273
<code>mclient_idle_timeout&nbsp;: <code class="type">float</code>;</code></td>
 
274
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >After how many seconds unused connections are closed.
 
275
              A negative value means never. 0 means immediately. A positive
 
276
              value is a point in time in the future.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
 
277
</tr>
 
278
<tr>
 
279
<td align="left" valign="top" >
 
280
<code>&nbsp;&nbsp;</code></td>
 
281
<td align="left" valign="top" >
 
282
<code>mclient_programs&nbsp;: <code class="type"><a href="Rpc_program.html#TYPEt">Rpc_program.t</a> list</code>;</code></td>
 
283
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The programs to bind</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
 
284
</tr>
 
285
<tr>
 
286
<td align="left" valign="top" >
 
287
<code>&nbsp;&nbsp;</code></td>
 
288
<td align="left" valign="top" >
 
289
<code>mclient_msg_timeout&nbsp;: <code class="type">float</code>;</code></td>
 
290
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >After how many seconds the reply must have been arrived.
 
291
              A negative value means there is no timeout. 0 means immediately. 
 
292
              A positive
 
293
              value is a point in time in the future.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
 
294
</tr>
 
295
<tr>
 
296
<td align="left" valign="top" >
 
297
<code>&nbsp;&nbsp;</code></td>
 
298
<td align="left" valign="top" >
 
299
<code>mclient_msg_timeout_is_fatal&nbsp;: <code class="type">bool</code>;</code></td>
 
300
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Whether a message timeout is to be considered as fatal error
 
301
              (the client is shut down, and the error counter for the endpoint
 
302
              is increased)</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
 
303
</tr>
 
304
<tr>
 
305
<td align="left" valign="top" >
 
306
<code>&nbsp;&nbsp;</code></td>
 
307
<td align="left" valign="top" >
 
308
<code>mclient_exception_handler&nbsp;: <code class="type">(exn -> unit) option</code>;</code></td>
 
309
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Whether to call <a href="Rpc_client.html#VALset_exception_handler"><code class="code">Rpc_client.set_exception_handler</code></a></td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
 
310
</tr>
 
311
<tr>
 
312
<td align="left" valign="top" >
 
313
<code>&nbsp;&nbsp;</code></td>
 
314
<td align="left" valign="top" >
 
315
<code>mclient_auth_methods&nbsp;: <code class="type"><a href="Rpc_client.auth_method-c.html">Rpc_client.auth_method</a> list</code>;</code></td>
 
316
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Set these authentication methods in the client</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
 
317
</tr>
 
318
<tr>
 
319
<td align="left" valign="top" >
 
320
<code>&nbsp;&nbsp;</code></td>
 
321
<td align="left" valign="top" >
 
322
<code>mclient_user_name&nbsp;: <code class="type">string option</code>;</code></td>
 
323
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The user name for authentication, None = default user</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
 
324
</tr>
 
325
<tr>
 
326
<td align="left" valign="top" >
 
327
<code>&nbsp;&nbsp;</code></td>
 
328
<td align="left" valign="top" >
 
329
<code>mclient_initial_ping&nbsp;: <code class="type">bool</code>;</code></td>
 
330
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Whether to call procedure 0 of the first program after
 
331
              connection establishment (see comments above)</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
 
332
</tr>
 
333
<tr>
 
334
<td align="left" valign="top" >
 
335
<code>&nbsp;&nbsp;</code></td>
 
336
<td align="left" valign="top" >
 
337
<code>mclient_max_response_length&nbsp;: <code class="type">int option</code>;</code></td>
 
338
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The maximum response length. See 
 
339
              <a href="Rpc_client.html#VALset_max_response_length"><code class="code">Rpc_client.set_max_response_length</code></a>.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
 
340
</tr>
 
341
<tr>
 
342
<td align="left" valign="top" >
 
343
<code>&nbsp;&nbsp;</code></td>
 
344
<td align="left" valign="top" >
 
345
<code>mclient_mstring_factories&nbsp;: <code class="type"><a href="Xdr_mstring.html#TYPEnamed_mstring_factories">Xdr_mstring.named_mstring_factories</a> option</code>;</code></td>
 
346
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The factories to use for decoding managed strings</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
 
347
</tr></table>
 
348
}
 
349
 
 
350
 
 
351
<pre><span id="EXCEPTIONService_unavailable"><span class="keyword">exception</span> Service_unavailable</span></pre>
 
352
<div class="info">
 
353
Procedure calls may end with this exception when the reliability
 
354
        cache disables the service<br>
 
355
</div>
 
356
<pre><span id="VALcreate_mclient_config"><span class="keyword">val</span> create_mclient_config</span> : <code class="type">?rcache:<a href="Rpc_proxy.ReliabilityCache.html#TYPErcache">Rpc_proxy.ReliabilityCache.rcache</a> -><br>       ?socket_config:<a href="Rpc_client.socket_config-c.html">Rpc_client.socket_config</a> -><br>       ?idle_timeout:float -><br>       ?programs:<a href="Rpc_program.html#TYPEt">Rpc_program.t</a> list -><br>       ?msg_timeout:float -><br>       ?msg_timeout_is_fatal:bool -><br>       ?exception_handler:(exn -> unit) -><br>       ?auth_methods:<a href="Rpc_client.auth_method-c.html">Rpc_client.auth_method</a> list -><br>       ?user_name:string option -><br>       ?initial_ping:bool -><br>       ?max_response_length:int -><br>       ?mstring_factories:<a href="Xdr_mstring.html#TYPEnamed_mstring_factories">Xdr_mstring.named_mstring_factories</a> -><br>       unit -> <a href="Rpc_proxy.ManagedClient.html#TYPEmclient_config">mclient_config</a></code></pre><br>
 
357
Create a config record. The optional arguments set the config
 
358
        components with the same name. The defaults are:<ul>
 
359
<li><code class="code">rcache</code>: Use the global reliability cache</li>
 
360
<li><code class="code">socket_config</code>: <a href="Rpc_client.default_socket_config-c.html"><code class="code">Rpc_client.default_socket_config</code></a></li>
 
361
<li><code class="code">programs</code>: The empty list. It is very advisable to fill this!</li>
 
362
<li><code class="code">msg_timeout</code>: (-1), i.e. none</li>
 
363
<li><code class="code">msg_timeout_is_fatal</code>: false</li>
 
364
<li><code class="code">exception_handler</code>: None</li>
 
365
<li><code class="code">auth_methods</code>: empty list</li>
 
366
<li><code class="code">user_name</code>: None</li>
 
367
<li><code class="code">initial_ping</code>: false</li>
 
368
<li><code class="code">max_response_length</code>: None</li>
 
369
<li><code class="code">mstring_factories</code>: None</li>
 
370
</ul>
 
371
<br>
 
372
<pre><span id="VALcreate_mclient"><span class="keyword">val</span> create_mclient</span> : <code class="type"><a href="Rpc_proxy.ManagedClient.html#TYPEmclient_config">mclient_config</a> -><br>       <a href="Rpc_client.html#TYPEconnector">Rpc_client.connector</a> -><br>       <a href="Unixqueue.event_system-c.html">Unixqueue.event_system</a> -> <a href="Rpc_proxy.ManagedClient.html#TYPEmclient">mclient</a></code></pre><div class="info">
 
373
Create a managed client for this config connecting to this
 
374
        connector. Only <code class="code">Internet</code> and <code class="code">Unix</code> connectors are supported.<br>
 
375
</div>
 
376
<pre><span id="TYPEstate"><span class="keyword">type</span> <code class="type"></code>state</span> = <code class="type">[ `Connecting | `Down | `Up of Unix.sockaddr option ]</code> </pre>
 
377
<div class="info">
 
378
The state:<ul>
 
379
<li><code class="code">`Down</code>: The initial state, and also reached after a socket
 
380
             error, or after one of the shutdown functions is called.
 
381
             Although <code class="code">`Down</code>, there might still some cleanup to do.
 
382
             When RPC functions are called, the client is automatically
 
383
             revived.</li>
 
384
<li><code class="code">`Connecting</code>: This state is used while the initial ping is
 
385
             done. It does not reflect whether the client is really 
 
386
             TCP-connected. Without initial ping, this state cannot occur.</li>
 
387
<li><code class="code">`Up s</code>: The client is (so far known) up and can be used.
 
388
             <code class="code">s</code> is the socket address of the local socket</li>
 
389
</ul>
 
390
<br>
 
391
</div>
 
392
 
 
393
<pre><span id="VALmclient_state"><span class="keyword">val</span> mclient_state</span> : <code class="type"><a href="Rpc_proxy.ManagedClient.html#TYPEmclient">mclient</a> -> <a href="Rpc_proxy.ManagedClient.html#TYPEstate">state</a></code></pre><div class="info">
 
394
Get the state<br>
 
395
</div>
 
396
<pre><span id="VALmclient_serial"><span class="keyword">val</span> mclient_serial</span> : <code class="type"><a href="Rpc_proxy.ManagedClient.html#TYPEmclient">mclient</a> -> int</code></pre><div class="info">
 
397
Get the serial number of the connection. The serial number is
 
398
        increased when the client is reconnected. If the client is down
 
399
        the serial number of the next connection attempt is returned.<br>
 
400
</div>
 
401
<pre><span id="VALpending_calls"><span class="keyword">val</span> pending_calls</span> : <code class="type"><a href="Rpc_proxy.ManagedClient.html#TYPEmclient">mclient</a> -> int</code></pre><div class="info">
 
402
Returns the number of pending calls<br>
 
403
</div>
 
404
<pre><span id="VALevent_system"><span class="keyword">val</span> event_system</span> : <code class="type"><a href="Rpc_proxy.ManagedClient.html#TYPEmclient">mclient</a> -> <a href="Unixqueue.event_system-c.html">Unixqueue.event_system</a></code></pre><div class="info">
 
405
Return the event system<br>
 
406
</div>
 
407
<pre><span id="VALshut_down"><span class="keyword">val</span> shut_down</span> : <code class="type"><a href="Rpc_proxy.ManagedClient.html#TYPEmclient">mclient</a> -> unit</code></pre><pre><span id="VALsync_shutdown"><span class="keyword">val</span> sync_shutdown</span> : <code class="type"><a href="Rpc_proxy.ManagedClient.html#TYPEmclient">mclient</a> -> unit</code></pre><pre><span id="VALtrigger_shutdown"><span class="keyword">val</span> trigger_shutdown</span> : <code class="type"><a href="Rpc_proxy.ManagedClient.html#TYPEmclient">mclient</a> -> (unit -> unit) -> unit</code></pre><div class="info">
 
408
Shut down the managed client. See the corresponding functions
 
409
        <a href="Rpc_client.html#VALshut_down"><code class="code">Rpc_client.shut_down</code></a>, <a href="Rpc_client.html#VALsync_shutdown"><code class="code">Rpc_client.sync_shutdown</code></a>, and
 
410
        <a href="Rpc_client.html#VALtrigger_shutdown"><code class="code">Rpc_client.trigger_shutdown</code></a><br>
 
411
</div>
 
412
<pre><span id="VALrecord_unavailability"><span class="keyword">val</span> record_unavailability</span> : <code class="type"><a href="Rpc_proxy.ManagedClient.html#TYPEmclient">mclient</a> -> unit</code></pre><div class="info">
 
413
Increases the error counter in the reliability cache for this
 
414
        connection. The only effect can be that the error counter
 
415
        exceeds the <code class="code">rcache_threshold</code> so that the server endpoint
 
416
        is disabled for some time. However, this only affects new 
 
417
        connections, not existing ones.
 
418
<p>
 
419
 
 
420
        For a stricter interpretation of errors see 
 
421
        <code class="code">enforce_unavailability</code>.
 
422
<p>
 
423
 
 
424
        The error counter is increased anyway when a socket error
 
425
        happens, or an RPC call times out and <code class="code">msg_timeout_is_fatal</code>
 
426
        is set. This function can be used to also interpret other
 
427
        misbehaviors as fatal errors.<br>
 
428
</div>
 
429
<pre><span id="VALenforce_unavailability"><span class="keyword">val</span> enforce_unavailability</span> : <code class="type"><a href="Rpc_proxy.ManagedClient.html#TYPEmclient">mclient</a> -> unit</code></pre><div class="info">
 
430
Enforces that all pending procedure calls get the
 
431
        <code class="code">Service_unavailable</code> exception, and that the client is shut down.
 
432
        The background is this: When the reliability cache discovers an
 
433
        unavailable port or host, only the new call is stopped with this
 
434
        exception, but older calls remain unaffected. This function
 
435
        can be used to change the policy, and to stop even pending calls.
 
436
<p>
 
437
 
 
438
        The difference to <code class="code">trigger_shutdown</code> is that the pending RPC
 
439
        calls get the exception <code class="code">Service_unavailable</code> instead of
 
440
        <a href="Rpc_client.html#EXCEPTIONMessage_lost"><code class="code">Rpc_client.Message_lost</code></a>, and that it is enforced that the
 
441
        shutdown is recorded as fatal error in the reliability cache.<br>
 
442
</div>
 
443
<pre><span id="VALset_batch_call"><span class="keyword">val</span> set_batch_call</span> : <code class="type"><a href="Rpc_proxy.ManagedClient.html#TYPEmclient">mclient</a> -> unit</code></pre><div class="info">
 
444
The next call is a batch call. See <a href="Rpc_client.html#VALset_batch_call"><code class="code">Rpc_client.set_batch_call</code></a><br>
 
445
</div>
 
446
<pre><span id="VALrpc_engine"><span class="keyword">val</span> rpc_engine</span> : <code class="type"><a href="Rpc_proxy.ManagedClient.html#TYPEmclient">mclient</a> -><br>       (<a href="Rpc_proxy.ManagedClient.html#TYPEmclient">mclient</a> -> 'a -> ((unit -> 'b) -> unit) -> unit) -><br>       'a -> 'b <a href="Uq_engines.engine-c.html">Uq_engines.engine</a></code></pre><div class="info">
 
447
Call an RPC function in engine style:
 
448
<p>
 
449
 
 
450
        <pre><code class="code"> let e = rpc_engine mc f_rpc </code></pre>
 
451
<p>
 
452
 
 
453
        where <code class="code">f_rpc</code> is one of the generated client functions (async
 
454
        signature). The engine reaches <code class="code">`Done r</code> when the result <code class="code">r</code>
 
455
        has arrived.
 
456
<p>
 
457
 
 
458
        The engine is not abortable (shut the client down instead).<br>
 
459
</div>
 
460
<pre><span id="VALcompare"><span class="keyword">val</span> compare</span> : <code class="type"><a href="Rpc_proxy.ManagedClient.html#TYPEmclient">mclient</a> -> <a href="Rpc_proxy.ManagedClient.html#TYPEmclient">mclient</a> -> int</code></pre><div class="info">
 
461
<code class="code">ManagedClient</code> can be used with <code class="code">Set.Make</code> and <code class="code">Map.Make</code><br>
 
462
</div>
 
463
<pre><span class="keyword">include</span> <a href="Rpc_client.USE_CLIENT.html">Rpc_client.USE_CLIENT</a></pre>
 
464
<br>
 
465
We implement the <code class="code">USE_CLIENT</code> interface for calling procedures<br>
 
466
</body></html>
 
 
b'\\ No newline at end of file'