masterIpcRcv( )

NAME

masterIpcRcv( ) - wait for a reply from the subagent

SYNOPSIS

INT_32_T masterIpcRcv 
    ( 
    EBUFFER_T *  pBuf,      /* buffer to be filled       */ 
    PTR_T        ipchandle  /* pointer to the IPC handle */ 
    )

DESCRIPTION

This routine waits for a response after query has been sent to the subagent. In the shipped implementation of the WindNet SNMP master agent, this function waits on a message queue that is local to the master agent. This message queue is used to facilitate communication between tSnmpd, the task that manages communication with the SNMP manager, and tMonQue, the task that manages communication between the SNMP master agent and its subagents.

In the shipped master agent code, subagents communicate with the master agent by putting messages on the message queue monitored by tMonQue. If the message is a control message, it is processed by snmpMasterHandlerWR( ). If the message is a query response, it is transferred to the local message queue on which masterIpcRcv( ) is waiting. All of this is handled synchronously. Thus, while the master agent is waiting for a response from the subagent, it is blocked. Normally, the amount of time spent blocked is quite short and is not a problem.

However, it is an imperfect world, so it is possible that a response for a query never makes it back to the subagent. To handle this possibility, the shipped version of the WindNet SNMP master agent puts a timeout on its wait for a query response. If you should rewrite the SNMP master agent for any reason, make sure that you preserve this timeout.

RETURNS

0, if the packet was received successfully; 1, if an error or a timeout has caused the objects to be marked inactive and subsequently removed; 2, if the master agent will allow the current packet to be processed without freeing objects.

SEE ALSO

masterIoLib