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>DbEnv::rep_set_limit()</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 11. Replication Methods" /> 11 <link rel="prev" href="repconfig.html" title="DbEnv::rep_set_config()" /> 12 <link rel="next" href="repnsites.html" title="DbEnv::rep_set_nsites()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DbEnv::rep_set_limit()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="repconfig.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 11. 23 Replication Methods 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="repnsites.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="repset_limit"></a>DbEnv::rep_set_limit()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40int 41DbEnv::rep_set_limit(u_int32_t gbytes, u_int32_t bytes); </pre> 42 <p> 43 The <code class="methodname">DbEnv::rep_set_limit()</code> method sets 44record transmission throttling. This is a byte-count limit on the 45 amount of data that will be transmitted from a site in response to a 46 single message processed by the 47 <a class="xref" href="repmessage.html" title="DbEnv::rep_process_message()">DbEnv::rep_process_message()</a> 48 method. The limit is not a hard limit, and the record that exceeds 49 the limit is the last record to be sent. 50 </p> 51 <p> 52 Record transmission throttling is turned on by default with a limit of 53 10MB. 54 </p> 55 <p> 56 If the values passed to the <code class="methodname">DbEnv::rep_set_limit()</code> method are both 57 zero, then the transmission limit is turned off. 58 </p> 59 <p> 60 The database environment's replication subsystem may also be configured using the 61 environment's <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file. The 62 syntax of the entry in that file is a single line with the string "rep_set_limit", one or 63 more whitespace characters, and the limit specified in two parts: the 64gigabytes and the 65 bytes values. For example, "rep_set_limit 0 1048576" sets a 1 megabyte limit.. Because 66 the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is read when 67 the database environment is opened, it will silently overrule configuration done before 68 that time. 69 </p> 70 <p> 71 The <code class="methodname">DbEnv::rep_set_limit()</code> method configures a database environment, 72 not only operations performed using the specified <a class="link" href="env.html" title="Chapter 5. The DbEnv Handle">DbEnv</a> 73 handle. 74 </p> 75 <p> 76 The <code class="methodname">DbEnv::rep_set_limit()</code> method may be called at any time during 77 the life of the application. 78 </p> 79 <p> 80 The <code class="methodname">DbEnv::rep_set_limit()</code> <span> 81 82 <span> 83 method either returns a non-zero error value or throws an 84 exception that encapsulates a non-zero error value on 85 failure, and returns 0 on success. 86 </span> 87 </span> 88 </p> 89 <div class="sect2" lang="en" xml:lang="en"> 90 <div class="titlepage"> 91 <div> 92 <div> 93 <h3 class="title"><a id="id1703210"></a>Parameters</h3> 94 </div> 95 </div> 96 </div> 97 <div class="sect3" lang="en" xml:lang="en"> 98 <div class="titlepage"> 99 <div> 100 <div> 101 <h4 class="title"><a id="id1703582"></a>bytes</h4> 102 </div> 103 </div> 104 </div> 105 <p> 106 The <span class="bold"><strong>bytes</strong></span> parameter specifies the number of 107 bytes which, when added to the <span class="bold"><strong>gbytes</strong></span> 108 parameter, specifies the maximum number of bytes that will be sent in a 109 single call to the <a class="xref" href="repmessage.html" title="DbEnv::rep_process_message()">DbEnv::rep_process_message()</a> 110 method. 111 </p> 112 </div> 113 <div class="sect3" lang="en" xml:lang="en"> 114 <div class="titlepage"> 115 <div> 116 <div> 117 <h4 class="title"><a id="id1703106"></a>gbytes</h4> 118 </div> 119 </div> 120 </div> 121 <p> 122 The <span class="bold"><strong>gbytes</strong></span> parameter specifies the number of 123 gigabytes which, when added to the <span class="bold"><strong>bytes</strong></span> 124 parameter, specifies the maximum number of bytes that will be sent in a 125 single call to the <a class="xref" href="repmessage.html" title="DbEnv::rep_process_message()">DbEnv::rep_process_message()</a> 126 method. 127 </p> 128 </div> 129 </div> 130 <div class="sect2" lang="en" xml:lang="en"> 131 <div class="titlepage"> 132 <div> 133 <div> 134 <h3 class="title"><a id="id1703716"></a>Class</h3> 135 </div> 136 </div> 137 </div> 138 <p> 139 <a class="link" href="env.html" title="Chapter 5. The DbEnv Handle">DbEnv</a> 140 </p> 141 </div> 142 <div class="sect2" lang="en" xml:lang="en"> 143 <div class="titlepage"> 144 <div> 145 <div> 146 <h3 class="title"><a id="id1703542"></a>See Also</h3> 147 </div> 148 </div> 149 </div> 150 <p> 151 <a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a> 152 </p> 153 </div> 154 </div> 155 <div class="navfooter"> 156 <hr /> 157 <table width="100%" summary="Navigation footer"> 158 <tr> 159 <td width="40%" align="left"><a accesskey="p" href="repconfig.html">Prev</a> </td> 160 <td width="20%" align="center"> 161 <a accesskey="u" href="rep.html">Up</a> 162 </td> 163 <td width="40%" align="right"> <a accesskey="n" href="repnsites.html">Next</a></td> 164 </tr> 165 <tr> 166 <td width="40%" align="left" valign="top">DbEnv::rep_set_config() </td> 167 <td width="20%" align="center"> 168 <a accesskey="h" href="index.html">Home</a> 169 </td> 170 <td width="40%" align="right" valign="top"> DbEnv::rep_set_nsites()</td> 171 </tr> 172 </table> 173 </div> 174 </body> 175</html> 176