Process a message again in a resource manager
#include <sys/resmgr.h> int resmgr_msg_again( resmgr_context_t *ctp, int rcvid);
- A pointer to a resmgr_context_t structure that the resource-manager library uses to pass context information between functions.
- The receive ID of the message that you want to process again.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
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.
- A fault occurred when the kernel tried to access the buffers provided.
- 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.
- The receive side of a message transfer encountered a memory fault accessing the receive/reply buffer.