Class: | DimExitHandler | |
---|---|---|
Library: | DIM | |
Author: | C. Gaspar | |
Version: | v1.0 | Update :Thu Feb 11 15:52:46 1999 |
Utility Class - Implements an Exit Handler for DIM
Servers
There are 4 occasions where a DIM server would exit if no
ExitHandler was declared:
- The DIM_DNS_NODE is undefined
- The DNS refuses connections from
the machine where this server is
- One of the services provided by
this service is already declared by another server
- The server got an "EXIT" command
from a client.
- The server got an "EXIT" command
from the DNS
If the user declares an exitHandler than it's is up to the
user to decide whether to exit or not.
Public Functions :
Example:
class ExitHandler : public
DimExitHandler
{
void
exitHandler( int code )
{
// cleanup
cout << "Exiting... " << endl;
exit(1);
}
public:
ExitHandler()
{DimServer::addExitHandler(this);}
};