#include <db.h>

DB_CHANNEL->send_msg(DB_CHANNEL *channel, DBT *msg, u_int32_t nmsg,
                     u_int32_t flags);  

The DB_CHANNEL->send_msg() method sends a message on the message channel. The message is sent asynchronously; the method does not wait for a response before returning. This method usually completes quickly because it only waits for the local TCP implementation to accept the bytes into its network data buffer. However, this message could block briefly for longer messages, and/or if the network data buffer is nearly full. This method could even block indefinitely if the remote site is slow to read.

If you want to block while waiting for a response from a remote site, use the DB_CHANNEL->send_request() method instead of this method.

The message sent by this method is received and handled at remote sites using a message dispatch callback, which is configured using the DB_ENV->repmgr_msg_dispatch() method. Note that the DB_CHANNEL->send_msg() method may be used within the the message dispatch callback on the remote site to send a response or acknowledgement for messages that it receives and is handling.

This method may be used on channels opened to any destination (see the DB_ENV->repmgr_channel() method for a list of potential destinations).

The DB_CHANNEL->send_msg() method returns a non-zero error value on failure and 0 on success.



Refers to an array of DBT handles. For more information, see The DBT Handle .

Any flags provided to the DBT handles used in this array are ignored.


Indicates how many elements are contained in the msg array.


This parameter is currently unused, and must be set to 0.


The DB_CHANNEL->send_msg() method may fail and return one of the following non-zero errors:


A message was sent to a remote site that has not configured a message dispatch call-back function. Use the DB_ENV->repmgr_msg_dispatch() method at every site belonging to the replication group to configure a message dispatch call-back function.


If this method is called from a Base API application, or if an invalid flag value or parameter was specified.



See Also

Replication and Related Methods