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.