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: DbEnv::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>DbEnv::set_rpc_server</b> 14</td> 15<td align=right> 16<a href="../api_cxx/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 <db_cxx.h> 23<p> 24int 25DbEnv::set_rpc_server(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: DbEnv::set_rpc_server</b> 30<p>Establishes a connection for this <b>dbenv</b> to a RPC server.</p> 31<p>When the DbEnv::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 DbEnv::set_rpc_server method configures operations performed using the specified 35<a href="../api_cxx/env_class.html">DbEnv</a> handle, not all operations performed on the underlying 36database environment.</p> 37<p>The DbEnv::set_rpc_server method may not be called after the <a href="../api_cxx/env_open.html">DbEnv::open</a> method is 38called. 39</p> 40<p>The DbEnv::set_rpc_server method 41either returns a non-zero error value 42or throws an exception that encapsulates a non-zero error value on 43failure, and returns 0 on success. 44</p> 45<b>Parameters</b> <br> 46 <b>cl_timeout</b><ul compact><li><a name="2"><!--meow--></a> 47The <b>cl_timeout</b> parameter specifies the number of seconds the client 48should wait for results to come back from the server. Once the timeout 49has expired on any communication with the server, DB_NOSERVER will 50be returned. If this value is zero, a default timeout is used.</ul> 51 <b>client</b><ul compact><li>If the <b>client</b> channel has been provided by the application then 52Berkeley DB will use it as its connection and the <b>host</b> and 53<b>cl_timeout</b> fields are ignored.</ul> 54 <b>host</b><ul compact><li>The <b>host</b> parameter is the host to which the Berkeley DB server will 55connect and create a channel for communication.</ul> 56 <b>flags</b><ul compact><li>The <b>flags</b> parameter is currently unused, and must be set to 0.</ul> 57<a name="3"><!--meow--></a> 58 <b>sv_timeout</b><ul compact><li>The <b>sv_timeout</b> parameter specifies the number of seconds the server 59should allow a client connection to remain idle before assuming that the 60client is gone. Once that timeout has been reached, the server releases 61all resources associated with that client connection. Subsequent attempts 62by that client to communicate with the server result in 63DB_NOSERVER_ID, indicating that an invalid identifier has been 64given to the server. This value can be considered a hint to the server. 65The server may alter this value based on its own policies or allowed 66values. If this value is zero, a default timeout is used.</ul> 67<br> 68<br><b>Errors</b> 69<p>The DbEnv::set_rpc_server method 70may fail and throw 71<a href="../api_cxx/except_class.html">DbException</a>, 72encapsulating one of the following non-zero errors, or return one of 73the following non-zero errors:</p> 74<br> 75<b>EINVAL</b><ul compact><li>An 76invalid flag value or parameter was specified.</ul> 77<br> 78<hr size=1 noshade> 79<br><b>Class</b> 80<a href="../api_cxx/env_class.html">DbEnv</a> 81<br><b>See Also</b> 82<a href="../api_cxx/env_list.html">Database Environments and Related Methods</a> 83</tt> 84<table width="100%"><tr><td><br></td><td align=right> 85<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a> 86</td></tr></table> 87<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 88</body> 89</html> 90