Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Event Manager Programmer's Guide: HP-UX 11i v3 Edition 1 > Chapter 3 The EVM Programming Interface

Handling Disconnections

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

If your program is a subscribing client, it is important that you handle EVM daemon disconnection correctly. EVM daemon disconnection must not occur under normal operation, but may occur in a system that is being tested or if a fault is encountered. If the EVM daemon terminates, it is usually restarted automatically within few seconds by the Essential Services Monitor daemon. For more information, see esmd(1M).

Although you must always test the return code from functions dealing with a connection, it is especially important to do so for a subscribing client. This is because a subscribing client may spend most of its time waiting for activity that depends on a proper connection.

If disconnected, your program drops out of its select or EvmConnWait call, and subsequent calls to EvmConnCheck and EvmConnDispatch returns failure status codes. If this happens, the program must not return immediately to the select or EvmConnWait call, because that results in a CPU-bound loop. Instead, determine whether the status code indicates a connection error and, if so, destroy the connection using EvmConnDestroy and then attempt to reconnect. If the initial attempt to reconnect fails, continue to retry the connection periodically until it is re-established. The recommended retry interval is once per second for the first 60 seconds, and every five seconds thereafter, until the connection is restored, because the daemon usually restarts automatically following any failure.

NOTE: Not all error codes returned by the connection functions indicate a disconnect.

In particular, the program can drop out of EvmConnWait as a result of a signal. If this is indicated, the correct action is to return immediately to the EvmConnWait call.

If your program is a posting client, you must deal with a disconnection only if you are using a permanent connection. For more information about connection, see “Choosing a Connection Policy”. You must be sure to examine the return status from EvmEventPost or EvmEventPostVa, and, if necessary, re-establish the connection and retry the post operation.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2007 Hewlett-Packard Development Company, L.P.