The program is stopped by CTRL-C
#include <iostream>
{
const string n = conf.
GetName()+
".log";
po::options_description config("Program options");
config.add_options()
("dns", var<string>("localhost"), "Dim nameserver (overwites DIM_DNS_NODE environment variable)")
("host", var<string>(""), "Address with which the Dim nameserver can connect to this host (overwites DIM_HOST_NODE environment variable)")
("log,l", var<string>(n), "Write log-file")
;
conf.
AddEnv(
"dns",
"DIM_DNS_NODE");
conf.
AddEnv(
"host",
"DIM_HOST_NODE");
}
{
cout <<
"The chatserv is a Dim-based chat server.\n"
"\n"
"It is a non-interactive program which acts as a relay of messages "
"sent via a Dim command CHAT/MSG and which are redirected to the "
"logging service CHAT/MESSAGE.\n"
"\n"
"Usage: chatserv [OPTIONS]\n"
" or: chatserv [OPTIONS]\n";
cout << endl;
}
{
}
{
private:
{
return GetCurrentState();
}
public:
{
AddEvent("MSG", "C")
("|msg[string]:message to be distributed");
}
};
int main(
int argc,
const char *argv[])
{
return 127;
cerr <<
"ERROR - Couldn't open log-file " << conf.
Get<
string>(
"log") <<
": " << strerror(errno) << endl;
}