| 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_channel()</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="repmgr_local_site.html" title="DbEnv::repmgr_local_site()" /> |
| 13 |
</head> |
| 14 |
<body> |
| 15 |
<div xmlns="" class="navheader"> |
| 16 |
<div class="libver"> |
| 17 |
<p>Library Version 11.2.5.3</p> |
| 18 |
</div> |
| 19 |
<table width="100%" summary="Navigation header"> |
| 20 |
<tr> |
| 21 |
<th colspan="3" align="center">DbEnv::repmgr_channel()</th> |
| 22 |
</tr> |
| 23 |
<tr> |
| 24 |
<td width="20%" align="left"><a accesskey="p" href="repsync.html">Prev</a> </td> |
| 25 |
<th width="60%" align="center">Chapter 11. |
| 26 |
Replication Methods |
| 27 |
</th> |
| 28 |
<td width="20%" align="right"> <a accesskey="n" href="repmgr_local_site.html">Next</a></td> |
| 29 |
</tr> |
| 30 |
</table> |
| 31 |
<hr /> |
| 32 |
</div> |
| 33 |
<div class="sect1" lang="en" xml:lang="en"> |
| 34 |
<div class="titlepage"> |
| 35 |
<div> |
| 36 |
<div> |
| 37 |
<h2 class="title" style="clear: both"><a id="repmgr_channel"></a>DbEnv::repmgr_channel()</h2> |
| 38 |
</div> |
| 39 |
</div> |
| 40 |
</div> |
| 41 |
<pre class="programlisting">#include <db_cxx.h> |
| 42 |
|
| 43 |
int |
| 44 |
DbEnv::repmgr_channel(int eid, DB_CHANNEL **channelp, u_int32_t flags);</pre> |
| 45 |
<p> |
| 46 |
The <code class="methodname">DbEnv::repmgr_channel()</code> method returns a |
| 47 |
DbChannel handle. This is used to create and manage custom |
| 48 |
message traffic between the sites in the replication group. |
| 49 |
</p> |
| 50 |
<p> |
| 51 |
This method allocates memory for the handle, returning a pointer to |
| 52 |
the structure in the memory to which |
| 53 |
<span class="bold"><strong>channelp</strong></span> refers. To release the |
| 54 |
allocated memory and discard the handle, call the |
| 55 |
<a class="xref" href="dbchannel_close.html" title="DbChannel::close()">DbChannel::close()</a> |
| 56 |
method. |
| 57 |
</p> |
| 58 |
<p> |
| 59 |
The <code class="methodname">DbEnv::repmgr_channel()</code> method may be |
| 60 |
called at any time after |
| 61 |
<a class="xref" href="repmgrstart.html" title="DbEnv::repmgr_start()">DbEnv::repmgr_start()</a> has |
| 62 |
been called with a <code class="literal">0</code> return code. |
| 63 |
</p> |
| 64 |
<p> |
| 65 |
The <code class="methodname">DbEnv::repmgr_channel()</code> <span> |
| 66 |
|
| 67 |
<span> |
| 68 |
method either returns a non-zero error value or throws an |
| 69 |
exception that encapsulates a non-zero error value on |
| 70 |
failure, and returns 0 on success. |
| 71 |
</span> |
| 72 |
</span> |
| 73 |
</p> |
| 74 |
<div class="sect2" lang="en" xml:lang="en"> |
| 75 |
<div class="titlepage"> |
| 76 |
<div> |
| 77 |
<div> |
| 78 |
<h3 class="title"><a id="idp9843560"></a>Parameters</h3> |
| 79 |
</div> |
| 80 |
</div> |
| 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="idp9843408"></a>eid</h4> |
| 87 |
</div> |
| 88 |
</div> |
| 89 |
</div> |
| 90 |
<p> |
| 91 |
This parameter must be set to one of the following: |
| 92 |
</p> |
| 93 |
<div class="itemizedlist"> |
| 94 |
<ul type="disc"> |
| 95 |
<li> |
| 96 |
<p> |
| 97 |
The numerical env ID of a remote site in the |
| 98 |
replication group. |
| 99 |
</p> |
| 100 |
</li> |
| 101 |
<li> |
| 102 |
<p> |
| 103 |
<code class="literal">DB_EID_MASTER</code> |
| 104 |
</p> |
| 105 |
<p> |
| 106 |
Messages sent on this channel are sent only to the |
| 107 |
master site. Note that messages are always sent to |
| 108 |
the current master, even if the master has changed |
| 109 |
since the channel was opened. If the current |
| 110 |
master is disconnected or unknown, the operation |
| 111 |
fails and repmgr returns an error code. |
| 112 |
</p> |
| 113 |
<p> |
| 114 |
If the local site is the master, then sending |
| 115 |
messages on this channel will result in the local |
| 116 |
site receiving those messages echoed back to |
| 117 |
itself. |
| 118 |
</p> |
| 119 |
</li> |
| 120 |
</ul> |
| 121 |
</div> |
| 122 |
</div> |
| 123 |
<div class="sect3" lang="en" xml:lang="en"> |
| 124 |
<div class="titlepage"> |
| 125 |
<div> |
| 126 |
<div> |
| 127 |
<h4 class="title"><a id="idp9849240"></a>channelp</h4> |
| 128 |
</div> |
| 129 |
</div> |
| 130 |
</div> |
| 131 |
<p> |
| 132 |
References memory into which a pointer to the |
| 133 |
allocated handle is copied. |
| 134 |
</p> |
| 135 |
</div> |
| 136 |
<div class="sect3" lang="en" xml:lang="en"> |
| 137 |
<div class="titlepage"> |
| 138 |
<div> |
| 139 |
<div> |
| 140 |
<h4 class="title"><a id="idp9846952"></a>flags</h4> |
| 141 |
</div> |
| 142 |
</div> |
| 143 |
</div> |
| 144 |
<p> |
| 145 |
This parameter is currently unused, and must be |
| 146 |
set to 0. |
| 147 |
</p> |
| 148 |
</div> |
| 149 |
</div> |
| 150 |
<div class="sect2" lang="en" xml:lang="en"> |
| 151 |
<div class="titlepage"> |
| 152 |
<div> |
| 153 |
<div> |
| 154 |
<h3 class="title"><a id="idp9845872"></a>Errors</h3> |
| 155 |
</div> |
| 156 |
</div> |
| 157 |
</div> |
| 158 |
<p> |
| 159 |
The <code class="methodname">DbEnv::repmgr_channel()</code> |
| 160 |
<span> |
| 161 |
|
| 162 |
<span> |
| 163 |
method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> |
| 164 |
exception, encapsulating one of the following non-zero errors, or return one |
| 165 |
of the following non-zero errors: |
| 166 |
</span> |
| 167 |
</span> |
| 168 |
</p> |
| 169 |
<div class="sect3" lang="en" xml:lang="en"> |
| 170 |
<div class="titlepage"> |
| 171 |
<div> |
| 172 |
<div> |
| 173 |
<h4 class="title"><a id="idp9857288"></a>EINVAL</h4> |
| 174 |
</div> |
| 175 |
</div> |
| 176 |
</div> |
| 177 |
<p> |
| 178 |
If this method is called from a Base API application; |
| 179 |
or if an invalid flag value or parameter was specified. |
| 180 |
</p> |
| 181 |
</div> |
| 182 |
</div> |
| 183 |
<div class="sect2" lang="en" xml:lang="en"> |
| 184 |
<div class="titlepage"> |
| 185 |
<div> |
| 186 |
<div> |
| 187 |
<h3 class="title"><a id="idp9856208"></a>Class</h3> |
| 188 |
</div> |
| 189 |
</div> |
| 190 |
</div> |
| 191 |
<p> |
| 192 |
<a class="link" href="env.html" title="Chapter 5. The DbEnv Handle">DbEnv</a> |
| 193 |
</p> |
| 194 |
</div> |
| 195 |
<div class="sect2" lang="en" xml:lang="en"> |
| 196 |
<div class="titlepage"> |
| 197 |
<div> |
| 198 |
<div> |
| 199 |
<h3 class="title"><a id="idp9851896"></a>See Also</h3> |
| 200 |
</div> |
| 201 |
</div> |
| 202 |
</div> |
| 203 |
<p> |
| 204 |
<a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a> |
| 205 |
</p> |
| 206 |
</div> |
| 207 |
</div> |
| 208 |
<div class="navfooter"> |
| 209 |
<hr /> |
| 210 |
<table width="100%" summary="Navigation footer"> |
| 211 |
<tr> |
| 212 |
<td width="40%" align="left"><a accesskey="p" href="repsync.html">Prev</a> </td> |
| 213 |
<td width="20%" align="center"> |
| 214 |
<a accesskey="u" href="rep.html">Up</a> |
| 215 |
</td> |
| 216 |
<td width="40%" align="right"> <a accesskey="n" href="repmgr_local_site.html">Next</a></td> |
| 217 |
</tr> |
| 218 |
<tr> |
| 219 |
<td width="40%" align="left" valign="top">DbEnv::rep_sync() </td> |
| 220 |
<td width="20%" align="center"> |
| 221 |
<a accesskey="h" href="index.html">Home</a> |
| 222 |
</td> |
| 223 |
<td width="40%" align="right" valign="top"> DbEnv::repmgr_local_site()</td> |
| 224 |
</tr> |
| 225 |
</table> |
| 226 |
</div> |
| 227 |
</body> |
| 228 |
</html> |