<!--$Id: env_set_rpc_server.so,v 10.29 2004/08/13 03:38:57 bostic Exp $--> <!--Copyright (c) 1997,2007 Oracle. All rights reserved.--> <!--See the file LICENSE for redistribution information.--> <html> <head> <title>Berkeley DB: DbEnv::set_rpc_server</title> <meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> <meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> </head> <body bgcolor=white> <table width="100%"><tr valign=top> <td> <h3>DbEnv::set_rpc_server</h3> </td> <td align=right> <a href="../../db46-devel-4.6.21/api_cxx/api_core.html"><img src="../../db46-devel-4.6.21/images/api.gif" alt="API"></a> <a href="../../db46-devel-4.6.21/ref/toc.html"><img src="../../db46-devel-4.6.21/images/ref.gif" alt="Ref"></a></td> </tr></table> <hr size=1 noshade> <tt> <h3><pre> #include <db_cxx.h> <p> int DbEnv::set_rpc_server(CLIENT *client, char *host, long cl_timeout, long sv_timeout, u_int32_t flags); </pre></h3> <hr size=1 noshade> <h3>Description: DbEnv::set_rpc_server</h3> <p>Establishes a connection for this <b>dbenv</b> to a RPC server.</p> <p>When the DbEnv::set_rpc_server method has been called, subsequent calls to Berkeley DB library interfaces may return or throw exceptions encapsulating <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> <p>The DbEnv::set_rpc_server method configures operations performed using the specified <a href="../../db46-devel-4.6.21/api_cxx/env_class.html">DbEnv</a> handle, not all operations performed on the underlying database environment.</p> <p>The DbEnv::set_rpc_server method may not be called after the <a href="../../db46-devel-4.6.21/api_cxx/env_open.html">DbEnv::open</a> method is called. </p> <p>The DbEnv::set_rpc_server method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success. </p> <h3>Parameters</h3> <dl compact> <dt><b>cl_timeout</b><dd><a name="2"><!--meow--></a> The <b>cl_timeout</b> parameter specifies the number of seconds the client should wait for results to come back from the server. Once the timeout has expired on any communication with the server, DB_NOSERVER will be returned. If this value is zero, a default timeout is used. <dt><b>client</b><dd>If the <b>client</b> channel has been provided by the application then Berkeley DB will use it as its connection and the <b>host</b> and <b>cl_timeout</b> fields are ignored. <dt><b>host</b><dd>The <b>host</b> parameter is the host to which the Berkeley DB server will connect and create a channel for communication. <dt><b>flags</b><dd>The <b>flags</b> parameter is currently unused, and must be set to 0. <a name="3"><!--meow--></a> <dt><b>sv_timeout</b><dd>The <b>sv_timeout</b> parameter specifies the number of seconds the server should allow a client connection to remain idle before assuming that the client is gone. Once that timeout has been reached, the server releases all resources associated with that client connection. Subsequent attempts by that client to communicate with the server result in DB_NOSERVER_ID, indicating that an invalid identifier has been given to the server. This value can be considered a hint to the server. The server may alter this value based on its own policies or allowed values. If this value is zero, a default timeout is used. </dl> <h3>Errors</h3> <p>The DbEnv::set_rpc_server method may fail and throw <a href="../../db46-devel-4.6.21/api_cxx/except_class.html">DbException</a>, encapsulating one of the following non-zero errors, or return one of the following non-zero errors:</p> <dl compact> <dt>EINVAL<dd>An invalid flag value or parameter was specified. </dl> <hr size=1 noshade> <h3>Class</h3> <a href="../../db46-devel-4.6.21/api_cxx/env_class.html">DbEnv</a> <h3>See Also</h3> <a href="../../db46-devel-4.6.21/api_cxx/env_list.html">Database Environments and Related Methods</a> </tt> <table width="100%"><tr><td><br></td><td align=right> <a href="../../db46-devel-4.6.21/api_cxx/api_core.html"><img src="../../db46-devel-4.6.21/images/api.gif" alt="API"></a><a href="../../db46-devel-4.6.21/ref/toc.html"><img src="../../db46-devel-4.6.21/images/ref.gif" alt="Ref"></a> </td></tr></table> <p><font size=1>Copyright (c) 1996,2007 Oracle. All rights reserved.</font> </body> </html>