Operating systems, development tools, and professional services
for connected embedded systems
for connected embedded systems
![]() |
![]() |
![]() |
![]() |
asyncmsg_connect_attach()
Establish a connection to be used for asynchronous messages between a process and a channel
![]() |
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_connect_attach (
uint32_t nd,
pid_t pid,
int chid,
unsigned index,
unsigned flags,
const struct _asyncmsg_connection_attr * attr);
Arguments:
- nd
- The node descriptor of the node on which the process that owns the channel is running.
- pid
- The process ID of the owner of the channel.
- chid
- The channel ID, returned by asyncmsg_channel_create(), of the channel to connect to the process.
- index
- The lowest acceptable connection ID.
- flags
- Flags that specify the type and attributes of the connection:
- _NTO_COF_NOSHARE
- User wants to use its own buffer; otherwise the user gets the buffer from the asyncmsg_malloc() call, fills it in and sends it by calling the asyncmsg_put() function.
- _NTO_COF_NONBLOCK
- Don't block waiting if all the send headers are in use.
- attr
- A pointer to an _asyncmsg_connection_attr structure that specifies the connection attributes.
Library:
libasyncmsg
Use the -l asyncmsg option to qcc to link against this library.
Description:
The asyncmsg_connect_attach() function establishes a connection between the calling process and a channel identified by the arguments nd, pid and chid. The system returns the first available connection ID starting at the value specified by the index argument.
Returns:
A connection ID, or -1 if an error occurred (errno is set).
Errors:
- EAGAIN
- All kernel channel objects are in use.
- ESRCH
- The node indicated by nd, the process indicated by pid or the channel indicated by chid does not exist.
Classification:
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | No |
| Thread | Yes |
See also:
asyncmsg_channel_create(), asyncmsg_channel_destroy(), asyncmsg_connect_attr(), asyncmsg_connect_detach(), asyncmsg_flush(), asyncmsg_free(), asyncmsg_get(), asyncmsg_malloc(), asyncmsg_put(), asyncmsg_putv()
Asynchronous Messaging Technote
![]() |
![]() |
![]() |
![]() |

![[Previous]](../prev.gif)
![[Contents]](../contents.gif)
![[Index]](../keyword_index.gif)
![[Next]](../next.gif)
