resmgr_msg_again()

Process a message again in a resource manager

Synopsis:

#include <sys/resmgr.h>

int resmgr_msg_again( resmgr_context_t *ctp,
                      int rcvid);

Arguments:

ctp
A pointer to a resmgr_context_t structure that the resource-manager library uses to pass context information between functions.
rcvid
The receive ID of the message that you want to process again.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The resmgr_msg_again() function reprocesses the message corresponding to the given rcvid. It does this by:

  • calling MsgInfo() and MsgRead() to refresh the resmgr_context_t structure to be as it was as when you originally received the message
  • calling MsgCurrent() to adjust your server threads' priority to that of the blocked client
  • processing the message as if it had just arrived

You use this function if your resource manager can't process a message right away. For example, if a read operation is blocked, your io_read handler would save the rcvid of the request, and then return _RESMGR_NOREPLY, leaving the client blocked. Later, when the resource manager can handle the request, it can call resmgr_msg_again() to reprocess the message.

Returns:

-1
Failure.
0
Success.

Errors:

EFAULT
A fault occurred when the kernel tried to access the buffers provided.
ESRCH
The thread indicated by rcvid doesn't exist, has had its connection detached, or isn't in either STATE_REPLY or STATE_NET_REPLY, or it isn't blocked on the connection associated with the rcvid.
ESRVRFAULT
The receive side of a message transfer encountered a memory fault accessing the receive/reply buffer.

Classification:

QNX Neutrino

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

Last modified: 2013-12-23

comments powered by Disqus