SNMP Subagent Programmer's Guide
Nowaited Hello World Program
2-22 119728—SNMP Subagent Programmer’s Guide
Programming Tutorials
8. If the AWAITIOX completion code is not set to CCE, an I/O operation was not
completed and FILE_GETINFO_ is called to determine what happened. Processing
continues based on the value returned in the error parameter:
•
If a timeout occurred, the subagent prints the current contents of helloText and
starts the wait block again.
•
If any other error condition occurred, the subagent prints a message identifying
the error and its associated file number. Although this sample subagent does not
provide it, logic for additional error handling would be appropriate at this point.
For example, you might want to re-try the management function
mgmt_init_env() if the error value is 201 (a process died). Refer to the
Guardian Programmer’s Guide for guidelines on interprocess communication.
9. If the AWAITIOX completion code is set to CCE, indicating that an I/O operation
completed, the file number returned by AWAITIOX (event_fileno) is compared with
that returned by mgmt_read_nowait() (agent_fileno).
10. If the file numbers match, a message has arrived from the NonStop agent. The call
to mgmt_poll() processes the message, using the value AWAITIOX stored in
count_xferd to determine how much to read from the allocated buffer.
11. If the file numbers do not match, the completed I/O operation was not an interaction
with the NonStop agent. The subagent prints a message identifying the file number,
and the wait block is executed again. Although this subagent does not include logic
for handling another file’s I/O operations, such logic would appear in this location.