This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
Send an asynchronous message to a connection
#include <sys/neutrino.h> #include <sys/asyncmsg.h> int asyncmsg_put(int coid, const void *buff, size_t size, unsigned handler), int asyncmsg_putv(int coid, const iov_t* iov, int parts, unsigned handler, int (*call_back) (int err, void* buf, unsigned handler)
libasyncmsg
Use the -l asyncmsg option to qcc to link against this library.
The asyncmsg_put() and asyncmsg_putv() functions take asynchronous messages from the buffer pointed to by buff, and sends them to the connections identified by the coid arguments. The messages could be associated with a user-defined handle which will be passed back in the call_back function (for error or buffer claim notification) to allow the user to quickly find out which package it is.
The call_back function tells the application that one of the messages is processed. If NULL is returned the call_back in the asyncmsg_connect_attach() will be used.
EOK on success; or -1 if an error occurred (errno is set).
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
asyncmsg_channel_create(), asyncmsg_channel_destroy(), asyncmsg_connect_attach(), asyncmsg_connect_attr(), asyncmsg_connect_detach(), asyncmsg_flush(), asyncmsg_free(), asyncmsg_get(), asyncmsg_malloc()
Asynchronous Messaging Technote