#include <db_cxx.h> int DbEnv::repmgr_channel(int eid, DB_CHANNEL **channelp, u_int32_t flags);
The DbEnv::repmgr_channel()
method returns a
DbChannel handle. This is used to create and manage custom
message traffic between the sites in the replication group.
This method allocates memory for the handle, returning a pointer to the structure in the memory to which channelp refers. To release the allocated memory and discard the handle, call the DbChannel::close() method.
The DbEnv::repmgr_channel()
method may be
called at any time after
DbEnv::repmgr_start()
has
been called with a 0
return code.
The DbEnv::repmgr_channel()
method either returns a non-zero error value or throws an
exception that encapsulates a non-zero error value on
failure, and returns 0 on success.
This parameter must be set to one of the following:
The numerical environment ID of a remote site in the replication group.
DB_EID_MASTER
Messages sent on this channel are sent only to the master site. Note that messages are always sent to the current master, even if the master has changed since the channel was opened. If the current master is disconnected or unknown, the operation fails and Replication Manager returns an error code.
If the local site is the master, then sending messages on this channel will result in the local site receiving those messages echoed back to itself.
The DbEnv::repmgr_channel()
method may fail and throw a DbException
exception, encapsulating one of the following non-zero errors, or return one
of the following non-zero errors:
If the eid parameter is
DB_EID_MASTER
but the current master is
disconnected or unknown.