qpid::broker::Daemon Class Reference

Tools for forking and managing a daemon process. More...

#include <Daemon.h>

List of all members.

Public Member Functions

void fork ()
 Fork a daemon process.

Static Public Member Functions

static pid_t getPid (uint16_t port)
 Check daemon is running on port, throw exception if not.

Protected Member Functions

virtual void parent ()=0
 Called in parent process.
virtual void child ()=0
 Called in child process.
uint16_t wait (int timeout)
 Call from parent(): wait for child to indicate it is ready.
void ready (uint16_t port)
 Call from child(): Notify the parent we are ready and write the PID file.


Detailed Description

Tools for forking and managing a daemon process.

NB: Only one Daemon instance is allowed in a process.


Member Function Documentation

void qpid::broker::Daemon::fork (  ) 

Fork a daemon process.

Call parent() in the parent process, child() in the child.

uint16_t qpid::broker::Daemon::wait ( int  timeout  )  [protected]

Call from parent(): wait for child to indicate it is ready.

in seconds to wait for response.

Returns:
port passed by child to ready().

void qpid::broker::Daemon::ready ( uint16_t  port  )  [protected]

Call from child(): Notify the parent we are ready and write the PID file.

Parameters:
port returned by parent call to wait().


The documentation for this class was generated from the following file:

Generated on Thu May 15 22:23:10 2008 for Qpid by  doxygen 1.5.5