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_set_local_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="repmgrset_ack_policy.html" title="DbEnv::repmgr_set_ack_policy()" /> 12 <link rel="next" href="repmgrsite_list.html" title="DbEnv::repmgr_site_list()" /> 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_set_local_site()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="repmgrset_ack_policy.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="repmgrsite_list.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="repmgrlocal_site"></a>DbEnv::repmgr_set_local_site()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40int 41repmgr_set_local_site(const char * host, u_int16_t port, u_int32_t flags); </pre> 42 <p> 43 The <code class="methodname">DbEnv::repmgr_set_local_site()</code> method specifies the host 44 identification string and port number for the local system. 45 </p> 46 <p> 47 The <code class="methodname">DbEnv::repmgr_set_local_site()</code> method may not be called after 48 the <a class="xref" href="repmgrstart.html" title="DbEnv::repmgr_start()">DbEnv::repmgr_start()</a> 49 method is called. 50 </p> 51 <p> 52 The <code class="methodname">DbEnv::repmgr_set_local_site()</code> <span> 53 54 <span> 55 method either returns a non-zero error value or throws an 56 exception that encapsulates a non-zero error value on 57 failure, and returns 0 on success. 58 </span> 59 </span> 60 </p> 61 <div class="sect2" lang="en" xml:lang="en"> 62 <div class="titlepage"> 63 <div> 64 <div> 65 <h3 class="title"><a id="id1707495"></a>Parameters</h3> 66 </div> 67 </div> 68 </div> 69 <div class="sect3" lang="en" xml:lang="en"> 70 <div class="titlepage"> 71 <div> 72 <div> 73 <h4 class="title"><a id="id1707534"></a>flags</h4> 74 </div> 75 </div> 76 </div> 77 <p> 78 The <span class="bold"><strong>flags</strong></span> parameter is currently 79 unused, and must be set to 0. 80 </p> 81 </div> 82 <div class="sect3" lang="en" xml:lang="en"> 83 <div class="titlepage"> 84 <div> 85 <div> 86 <h4 class="title"><a id="id1707864"></a>host</h4> 87 </div> 88 </div> 89 </div> 90 <p> 91 The site's host identification string, generally a TCP/IP host name. 92 </p> 93 </div> 94 <div class="sect3" lang="en" xml:lang="en"> 95 <div class="titlepage"> 96 <div> 97 <div> 98 <h4 class="title"><a id="id1707781"></a>port</h4> 99 </div> 100 </div> 101 </div> 102 <p> 103 The port number on which the local site is listening. 104 </p> 105 </div> 106 </div> 107 <div class="sect2" lang="en" xml:lang="en"> 108 <div class="titlepage"> 109 <div> 110 <div> 111 <h3 class="title"><a id="id1707327"></a>Errors</h3> 112 </div> 113 </div> 114 </div> 115 <p> 116 The <code class="methodname">DbEnv::repmgr_set_local_site()</code> 117 <span> 118 119 <span> 120 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> 121 exception, encapsulating one of the following non-zero errors, or return one 122 of the following non-zero errors: 123 </span> 124 </span> 125 </p> 126 <div class="sect3" lang="en" xml:lang="en"> 127 <div class="titlepage"> 128 <div> 129 <div> 130 <h4 class="title"><a id="id1707745"></a>EINVAL</h4> 131 </div> 132 </div> 133 </div> 134 <p> 135 If this method is called from a Base API 136 application; 137 if the method was called after replication is started 138with a call to the <a class="xref" href="repmgrstart.html" title="DbEnv::repmgr_start()">DbEnv::repmgr_start()</a> 139method; 140 or if an invalid flag value or parameter was specified. 141 </p> 142 </div> 143 </div> 144 <div class="sect2" lang="en" xml:lang="en"> 145 <div class="titlepage"> 146 <div> 147 <div> 148 <h3 class="title"><a id="id1707746"></a>Class</h3> 149 </div> 150 </div> 151 </div> 152 <p> 153 <a class="link" href="env.html" title="Chapter 5. The DbEnv Handle">DbEnv</a> 154 </p> 155 </div> 156 <div class="sect2" lang="en" xml:lang="en"> 157 <div class="titlepage"> 158 <div> 159 <div> 160 <h3 class="title"><a id="id1707599"></a>See Also</h3> 161 </div> 162 </div> 163 </div> 164 <p> 165 <a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a> 166 </p> 167 </div> 168 </div> 169 <div class="navfooter"> 170 <hr /> 171 <table width="100%" summary="Navigation footer"> 172 <tr> 173 <td width="40%" align="left"><a accesskey="p" href="repmgrset_ack_policy.html">Prev</a> </td> 174 <td width="20%" align="center"> 175 <a accesskey="u" href="rep.html">Up</a> 176 </td> 177 <td width="40%" align="right"> <a accesskey="n" href="repmgrsite_list.html">Next</a></td> 178 </tr> 179 <tr> 180 <td width="40%" align="left" valign="top">DbEnv::repmgr_set_ack_policy() </td> 181 <td width="20%" align="center"> 182 <a accesskey="h" href="index.html">Home</a> 183 </td> 184 <td width="40%" align="right" valign="top"> DbEnv::repmgr_site_list()</td> 185 </tr> 186 </table> 187 </div> 188 </body> 189</html> 190