Main Page   Compound List   File List   Compound Members   File Members   Related Pages  

ahm_lib.h File Reference

#include "appHeartbeatMonitor.h"

Go to the source code of this file.

Compounds

struct  internal_reg_info

Defines

#define REGISTRATION_DIRECTORY   "/var/appmonitord"

Functions

int ok_to_send_heartbeat (int a_fd)
int create_heartbeat_fifo (struct internal_reg_info **a_reginfo)
int create_registration_file (struct internal_reg_info **a_reginfo)

Variables

int ahm_fifo_fd
int errno


Define Documentation

#define REGISTRATION_DIRECTORY   "/var/appmonitord"
 


Function Documentation

int create_heartbeat_fifo struct internal_reg_info **    a_reginfo
 

This is a private function. Creates and opens the fifo to which heartbeats will be written. If an error occurs in creating the fifo or in opening it, the fifo will be removed (if it was created) and the error code from the appropriate failed call will be returned. If it is created successfully, the file descriptor will be stored in the provided structure.

NOTE: This function does not support multiple heartbeats from a single application due to handling of the FIFO file descriptor.

Parameters:
a_reginfo  The structure containing the fifo name and the return location for the file descriptor.
Returns:
zero on success Returns the error code from mkfifo and/or open depending which of these may fail.

int create_registration_file struct internal_reg_info **    a_reginfo
 

This is a private function. Handles creation of the registration file and filling it with the registration information. If any point fails during creation of the registration file, the file is removed from the registration directory and an error code is returned.

Parameters:
a_reginfo  This is the internal registration structure containing the pid and other registration specific information
Returns:
EINVAL If the registration filename is invalid or if the registration information is invalid EEXIST If the registration filename already exists EFAULT If the time function errored 0 on successful registration file creation

int ok_to_send_heartbeat int    a_fd
 

This is a private function. It is used internally to determine if writing to the heartbeat FIFO will block. This keeps the client from filling the FIFO and allows us to know if there is a reading accepting heartbeats.

Parameters:
a_fd  The file descriptor of the FIFO
Returns:
zero on failure; non-zero on success (i.e. the write will not block).


Variable Documentation

int ahm_fifo_fd  
 

This is used when the client wishes to have the library set up a callback for sending heartbeats using setitimer and a signal handler for SIGALRM.

int errno
 


Generated on Wed Oct 30 15:14:42 2002 for Application Heartbeat Monitor Client Library by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002