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::repmgr_add_remote_site()</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="repsync.html" title="DbEnv::rep_sync()" /> 12 <link rel="next" href="repmgrget_ack_policy.html" title="DbEnv::repmgr_get_ack_policy()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DbEnv::repmgr_add_remote_site()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="repsync.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="repmgrget_ack_policy.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="repmgrremote_site"></a>DbEnv::repmgr_add_remote_site()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40int 41DbEnv::repmgr_add_remote_site(const char *host, u_int port, int *eidp, u_int32_t flags);</pre> 42 <p> 43 The <code class="methodname">DbEnv::repmgr_add_remote_site()</code> method adds a new replication 44 site to the Replication Manager's list of known sites. It is not 45 necessary for all sites in a replication group to know about all other 46 sites in the group. 47 </p> 48 <p> 49 The <code class="methodname">DbEnv::repmgr_add_remote_site()</code> method may be called at any time 50 during the life of the application. 51 </p> 52 <p> 53 The <code class="methodname">DbEnv::repmgr_add_remote_site()</code> <span> 54 55 <span> 56 method either returns a non-zero error value or throws an 57 exception that encapsulates a non-zero error value on 58 failure, and returns 0 on success. 59 </span> 60 </span> 61 </p> 62 <div class="sect2" lang="en" xml:lang="en"> 63 <div class="titlepage"> 64 <div> 65 <div> 66 <h3 class="title"><a id="id1706839"></a>Parameters</h3> 67 </div> 68 </div> 69 </div> 70 <div class="sect3" lang="en" xml:lang="en"> 71 <div class="titlepage"> 72 <div> 73 <div> 74 <h4 class="title"><a id="id1707016"></a>eidp</h4> 75 </div> 76 </div> 77 </div> 78 <p> 79 If <span class="bold"><strong>eidp</strong></span> is non-NULL, and the database 80 environment has already been opened by calling 81 <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a>, then the environment 82 ID assigned to the remote site is returned in the memory location 83 referenced by <span class="bold"><strong>eidp</strong></span>. 84 </p> 85 </div> 86 <div class="sect3" lang="en" xml:lang="en"> 87 <div class="titlepage"> 88 <div> 89 <div> 90 <h4 class="title"><a id="id1707193"></a>flags</h4> 91 </div> 92 </div> 93 </div> 94 <p> 95 The <span class="bold"><strong>flags</strong></span> parameter must be set to 0 96 or by bitwise inclusively <span class="bold"><strong>OR</strong></span>'ing 97 together one or more of the following values: 98 </p> 99 <div class="itemizedlist"> 100 <ul type="disc"> 101 <li> 102 <p> 103 <code class="literal">DB_REPMGR_PEER</code> 104 </p> 105 <p> 106 Specifying the <code class="literal">DB_REPMGR_PEER</code> flag configures client-to-client 107 synchronization with the specified remote site. 108 </p> 109 <p> 110 Currently, the Replication Manager framework only supports a single 111 client peer, and the last specified peer is used. 112 </p> 113 </li> 114 </ul> 115 </div> 116 </div> 117 <div class="sect3" lang="en" xml:lang="en"> 118 <div class="titlepage"> 119 <div> 120 <div> 121 <h4 class="title"><a id="id1707361"></a>host</h4> 122 </div> 123 </div> 124 </div> 125 <p> 126 The site's host identification string, generally a TCP/IP host name. 127 </p> 128 </div> 129 <div class="sect3" lang="en" xml:lang="en"> 130 <div class="titlepage"> 131 <div> 132 <div> 133 <h4 class="title"><a id="id1707370"></a>port</h4> 134 </div> 135 </div> 136 </div> 137 <p> 138 The port number on which the remote site is receiving. 139 </p> 140 </div> 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="id1707284"></a>Errors</h3> 147 </div> 148 </div> 149 </div> 150 <p> 151 The <code class="methodname">DbEnv::repmgr_add_remote_site()</code> 152 <span> 153 154 <span> 155 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter��6.��The DbException Class">DbException</a> 156 exception, encapsulating one of the following non-zero errors, or return one 157 of the following non-zero errors: 158 </span> 159 </span> 160 </p> 161 <div class="sect3" lang="en" xml:lang="en"> 162 <div class="titlepage"> 163 <div> 164 <div> 165 <h4 class="title"><a id="id1707281"></a>EINVAL</h4> 166 </div> 167 </div> 168 </div> 169 <p> 170 If this method is called from a base replication API 171 application; or if an invalid flag value or parameter was 172 specified. 173 </p> 174 </div> 175 </div> 176 <div class="sect2" lang="en" xml:lang="en"> 177 <div class="titlepage"> 178 <div> 179 <div> 180 <h3 class="title"><a id="id1707042"></a>Class</h3> 181 </div> 182 </div> 183 </div> 184 <p> 185 <a class="link" href="env.html" title="Chapter��5.�� The DbEnv Handle">DbEnv</a> 186 </p> 187 </div> 188 <div class="sect2" lang="en" xml:lang="en"> 189 <div class="titlepage"> 190 <div> 191 <div> 192 <h3 class="title"><a id="id1707013"></a>See Also</h3> 193 </div> 194 </div> 195 </div> 196 <p> 197 <a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a> 198 </p> 199 </div> 200 </div> 201 <div class="navfooter"> 202 <hr /> 203 <table width="100%" summary="Navigation footer"> 204 <tr> 205 <td width="40%" align="left"><a accesskey="p" href="repsync.html">Prev</a>��</td> 206 <td width="20%" align="center"> 207 <a accesskey="u" href="rep.html">Up</a> 208 </td> 209 <td width="40%" align="right">��<a accesskey="n" href="repmgrget_ack_policy.html">Next</a></td> 210 </tr> 211 <tr> 212 <td width="40%" align="left" valign="top">DbEnv::rep_sync()��</td> 213 <td width="20%" align="center"> 214 <a accesskey="h" href="index.html">Home</a> 215 </td> 216 <td width="40%" align="right" valign="top">��DbEnv::repmgr_get_ack_policy()</td> 217 </tr> 218 </table> 219 </div> 220 </body> 221</html> 222