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 ManagerProgrammer's Guide: HP-UX 11i v3Edition 1 > Chapter 3 The EVM Programming Interface

Choosing a Connection Policy

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

If your program is a posting client, you must choose a policy for connecting to the EVM daemon. You can choose one of the following options:

  • Create a connection when the program starts, and maintain it until the program terminates (permanent connection).

  • Create a connection each time that you need to post an event, and destroy it immediately afterwards (transient connection).

The cost in processing time of creating an EVM connection is significant, because the setup and authentication protocol require several message transactions as well as some file I/O. As a general rule, you must maintain a permanent connection if you want to post events frequently during normal program operation. If you choose this option, your code must handle unexpected disconnection if the EVM daemon is terminated. For information about handling disconnection, see “Handling Disconnections”.

If you expect to post events infrequently — for example, only if unexpected errors occur — consider using a transient connection. Although a transient connection is more expensive in set-up time if multiple events are posted, it eliminates both the system resource cost of a permanent connection and the need for your code to deal with an unexpected disconnection. The simplest way to post events to the local daemon with a transient connection is to pass NULL as the connection argument to EvmEventPost() or EvmEventPostVa().

If you do not require a permanent connection, but you expect to post several events over a short period under some circumstances; consider creating a temporary connection that you will destroy when the activity is completed, rather than posting successive events using a separate connection for each.

Subscribing clients must maintain permanent connections to be assured of receiving events.

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