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_site_list()</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="repmgrlocal_site.html" title="DbEnv::repmgr_set_local_site()" /> 12 <link rel="next" href="repmgrstart.html" title="DbEnv::repmgr_start()" /> 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_site_list()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="repmgrlocal_site.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="repmgrstart.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="repmgrsite_list"></a>DbEnv::repmgr_site_list()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40int 41DbEnv::repmgr_site_list(u_int *countp, DB_REPMGR_SITE **listp);</pre> 42 <p> 43 The <code class="methodname">DbEnv::repmgr_site_list()</code> method returns the status of the 44 sites currently known by the Replication Manager. 45 </p> 46 <p> 47 The <code class="methodname">DbEnv::repmgr_site_list()</code> method creates a statistical 48 structure of type <code class="literal">DB_REPMGR_SITE</code> and copies a pointer to it into a 49 user-specified memory location. 50 </p> 51 <p> 52 Statistical structures are stored in allocated memory. If application-specific allocation routines have been 53 declared (see <a class="xref" href="envset_alloc.html" title="DbEnv::set_alloc()">DbEnv::set_alloc()</a> for more information), 54 they are used to allocate the memory; otherwise, the standard C library 55 <span class="bold"><strong>malloc</strong></span>(3) is used. The caller is responsible for deallocating 56 the memory. To deallocate the memory, free the memory reference; references inside the returned 57 memory need not be individually freed. 58 </p> 59 <p> 60 The following <code class="literal">DB_REPMGR_SITE</code> fields will be filled in: 61 </p> 62 <div class="itemizedlist"> 63 <ul type="disc"> 64 <li> 65 <p> 66 <span class="bold"><strong>int eid;</strong></span> 67 </p> 68 <p> 69 Environment ID assigned by the Replication Manager. This is the same value that is passed to 70 the application's event notification function for the 71 <a class="link" href="envevent_notify.html#event_notify_DB_EVENT_REP_NEWMASTER">DB_EVENT_REP_NEWMASTER</a> 72 event. 73 </p> 74 </li> 75 <li> 76 <p> 77 <span class="bold"><strong>char host[];</strong></span> 78 </p> 79 <p> 80 Null-terminated host name. 81 </p> 82 </li> 83 <li> 84 <p> 85 <span class="bold"><strong>u_int port;</strong></span> 86 </p> 87 <p> 88 TCP/IP port number. 89 </p> 90 </li> 91 <li> 92 <p> 93 <span class="bold"><strong>u_int32_t status;</strong></span> 94 </p> 95 <p> 96 Zero (if unknown), or one of the following 97 constants: <code class="literal">DB_REPMGR_CONNECTED</code>, 98 <code class="literal">DB_REPMGR_DISCONNECTED</code>. 99 </p> 100 </li> 101 </ul> 102 </div> 103 <p> 104 The <code class="methodname">DbEnv::repmgr_site_list()</code> method may be called at any time 105 during the life of the application. 106 </p> 107 <p> 108 The <code class="methodname">DbEnv::repmgr_site_list()</code> <span> 109 110 <span> 111 method either returns a non-zero error value or throws an 112 exception that encapsulates a non-zero error value on 113 failure, and returns 0 on success. 114 </span> 115 </span> 116 </p> 117 <div class="sect2" lang="en" xml:lang="en"> 118 <div class="titlepage"> 119 <div> 120 <div> 121 <h3 class="title"><a id="id1707460"></a>Parameters</h3> 122 </div> 123 </div> 124 </div> 125 <div class="sect3" lang="en" xml:lang="en"> 126 <div class="titlepage"> 127 <div> 128 <div> 129 <h4 class="title"><a id="id1708117"></a>countp</h4> 130 </div> 131 </div> 132 </div> 133 <p> 134 A count of the returned structures will be stored into the memory referenced by 135 <span class="bold"><strong>countp</strong></span>. 136 </p> 137 </div> 138 <div class="sect3" lang="en" xml:lang="en"> 139 <div class="titlepage"> 140 <div> 141 <div> 142 <h4 class="title"><a id="id1708162"></a>listp</h4> 143 </div> 144 </div> 145 </div> 146 <p> 147 A reference to an array of structures will be stored into the memory referenced by 148 <span class="bold"><strong>listp</strong></span>. 149 </p> 150 </div> 151 </div> 152 <div class="sect2" lang="en" xml:lang="en"> 153 <div class="titlepage"> 154 <div> 155 <div> 156 <h3 class="title"><a id="id1708176"></a>Class</h3> 157 </div> 158 </div> 159 </div> 160 <p> 161 <a class="link" href="env.html" title="Chapter��5.�� The DbEnv Handle">DbEnv</a> 162 </p> 163 </div> 164 <div class="sect2" lang="en" xml:lang="en"> 165 <div class="titlepage"> 166 <div> 167 <div> 168 <h3 class="title"><a id="id1708004"></a>See Also</h3> 169 </div> 170 </div> 171 </div> 172 <p> 173 <a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a> 174 </p> 175 </div> 176 </div> 177 <div class="navfooter"> 178 <hr /> 179 <table width="100%" summary="Navigation footer"> 180 <tr> 181 <td width="40%" align="left"><a accesskey="p" href="repmgrlocal_site.html">Prev</a>��</td> 182 <td width="20%" align="center"> 183 <a accesskey="u" href="rep.html">Up</a> 184 </td> 185 <td width="40%" align="right">��<a accesskey="n" href="repmgrstart.html">Next</a></td> 186 </tr> 187 <tr> 188 <td width="40%" align="left" valign="top">DbEnv::repmgr_set_local_site()��</td> 189 <td width="20%" align="center"> 190 <a accesskey="h" href="index.html">Home</a> 191 </td> 192 <td width="40%" align="right" valign="top">��DbEnv::repmgr_start()</td> 193 </tr> 194 </table> 195 </div> 196 </body> 197</html> 198