asyncmsg_put(), asyncmsg_putv()

Send an asynchronous message to a connection


Caution: Asynchronous messaging is an experimental feature; for information about the use of experimental software, see the Commercial Software License Agreement (CSLA) or Partner Software License Agreement (PSLA) in the Licensing area of our website, http://www.qnx.com/legal/licensing/.

Synopsis:

#include <sys/asyncmsg.h>

int asyncmsg_put( int coid,
                  const void *buff,
                  size_t size, 
                  unsigned handle),
                  int (*call_back) (
                           int err,
                           void* buf,
                           unsigned handle ));
  
int asyncmsg_putv( int coid,
                   const iov_t* iov,
                   int parts, 
                   unsigned handle,
                   int (*call_back) (
                            int err,
                            void* buf,
                            unsigned handle ));

Arguments:

coid
The ID of the connection to send the message to.
buff
(asyncmsg_put() only) A pointer to the buffer that holds the message.
size
(asyncmsg_put() only) The size of the message.
iov
(asyncmsg_putv() only) A pointer to an array of IOV buffers that hold message.
parts
(asyncmsg_putv() only) The number of elements in the IOV array.
handle
A user-defined handle that's passed to the call_back function to allow for quick identification of the message's package.
call_back
NULL, or a function to call when a message is processed. If this argument is NULL, the call_back specified in the _asyncmsg_connection_attr passed to asyncmsg_connect_attach() is called.

Library:

libasyncmsg

Use the -l asyncmsg option to qcc to link against this library.

Description:

The asyncmsg_put() and asyncmsg_putv() functions send an asynchronous message to the connection identified by the coid argument:

You can use the handle, which is passed to the call_back function, to help you identify the message.

Returns:

EOK, or -1 if an error occurred (errno is set).

Errors:

EBADF
The connection specified by coid doesn't exist.
EFAULT
A fault occurred when the kernel tried to access the buffers provided.
EAGAIN
The send queue is full.

Classification:

QNX Neutrino

Safety:
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes

See also:

asyncmsg_channel_create(), asyncmsg_channel_destroy(), asyncmsg_connect_attach(), asyncmsg_connect_attr(), _asyncmsg_connection_attr, asyncmsg_connect_detach(), asyncmsg_flush(), asyncmsg_free(), asyncmsg_get(), asyncmsg_malloc()

Asynchronous Messaging technote