1<!--$Id: env_set_rpc_server.so,v 10.29 2004/08/13 03:38:57 bostic Exp $-->
2<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
3<!--See the file LICENSE for redistribution information.-->
4<html>
5<head>
6<title>Berkeley DB: DB_ENV-&gt;set_rpc_server</title>
7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
9</head>
10<body bgcolor=white>
11<table width="100%"><tr valign=top>
12<td>
13<b>DB_ENV-&gt;set_rpc_server</b>
14</td>
15<td align=right>
16<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a>
17<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td>
18</tr></table>
19<hr size=1 noshade>
20<tt>
21<b><pre>
22#include &lt;db.h&gt;
23<p>
24int
25DB_ENV-&gt;set_rpc_server(DB_ENV *dbenv, CLIENT *client, char *host,
26    long cl_timeout, long sv_timeout, u_int32_t flags);
27</pre></b>
28<hr size=1 noshade>
29<b>Description: DB_ENV-&gt;set_rpc_server</b>
30<p>Establishes a connection for this <b>dbenv</b> to a RPC server.</p>
31<p>When the DB_ENV-&gt;set_rpc_server method has been called, subsequent calls
32to Berkeley DB library interfaces may return or throw exceptions encapsulating
33<a name="DB_NOSERVER">DB_NOSERVER</a>, <a name="DB_NOSERVER_ID">DB_NOSERVER_ID</a>, or <a name="DB_NOSERVER_HOME">DB_NOSERVER_HOME</a>.</p>
34<p>The DB_ENV-&gt;set_rpc_server method configures operations performed using the specified
35<a href="../api_c/env_class.html">DB_ENV</a> handle, not all operations performed on the underlying
36database environment.</p>
37<p>The DB_ENV-&gt;set_rpc_server method may not be called after the <a href="../api_c/env_open.html">DB_ENV-&gt;open</a> method is
38called.
39</p>
40<p>The DB_ENV-&gt;set_rpc_server method
41returns a non-zero error value on failure
42and 0 on success.
43</p>
44<b>Parameters</b> <br>
45 <b>cl_timeout</b><ul compact><li><a name="2"><!--meow--></a>
46The <b>cl_timeout</b> parameter specifies the number of seconds the client
47should wait for results to come back from the server.  Once the timeout
48has expired on any communication with the server, DB_NOSERVER will
49be returned.  If this value is zero, a default timeout is used.</ul>
50 <b>client</b><ul compact><li>If the <b>client</b> channel has been provided by the application then
51Berkeley DB will use it as its connection and the <b>host</b> and
52<b>cl_timeout</b> fields are ignored.</ul>
53 <b>host</b><ul compact><li>The <b>host</b> parameter is the host to which the Berkeley DB server will
54connect and create a channel for communication.</ul>
55 <b>flags</b><ul compact><li>The <b>flags</b> parameter is currently unused, and must be set to 0.</ul>
56<a name="3"><!--meow--></a>
57 <b>sv_timeout</b><ul compact><li>The <b>sv_timeout</b> parameter specifies the number of seconds the server
58should allow a client connection to remain idle before assuming that the
59client is gone.  Once that timeout has been reached, the server releases
60all resources associated with that client connection.  Subsequent attempts
61by that client to communicate with the server result in
62DB_NOSERVER_ID, indicating that an invalid identifier has been
63given to the server.  This value can be considered a hint to the server.
64The server may alter this value based on its own policies or allowed
65values.  If this value is zero, a default timeout is used.</ul>
66<br>
67<br><b>Errors</b>
68<p>The DB_ENV-&gt;set_rpc_server method
69may fail and return one of the following non-zero errors:</p>
70<br>
71<b>EINVAL</b><ul compact><li>An
72invalid flag value or parameter was specified.</ul>
73<br>
74<hr size=1 noshade>
75<br><b>Class</b>
76<a href="../api_c/env_class.html">DB_ENV</a>
77<br><b>See Also</b>
78<a href="../api_c/env_list.html">Database Environments and Related Methods</a>
79</tt>
80<table width="100%"><tr><td><br></td><td align=right>
81<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a>
82</td></tr></table>
83<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
84</body>
85</html>
86