19 #include <cc++/slog.h>
20 #include <cc++/process.h>
27 #ifdef CCXX_NAMESPACES
34 const char *reason =
"exiting";
39 ::signal(SIGPIPE, SIG_IGN);
44 ::remove(
".phonepid");
52 open(
"/dev/null", O_RDWR);
53 open(
"/dev/null", O_RDWR);
54 open(
"/dev/null", O_RDWR);
55 slog.open(
"phone", Slog::classDaemon);
56 slog.level(Slog::levelNotice);
57 slog(Slog::levelNotice) <<
"daemon mode started" << std::endl;
61 slog.open(
"phone", Slog::classDaemon);
62 slog.level(Slog::levelDebug);
63 slog(Slog::levelNotice) <<
"server starting..." << std::endl;
65 snprintf(buf, 11,
"%d", getpid());
66 fd = ::creat(
".phonepid", 0660);
72 fifo.open(
".phonectrl", std::ios::in | std::ios::out);
75 slog(Slog::levelError) <<
"fifo failed; exiting" << std::endl;
82 fifo.getline(buf, 256);
86 ep = strrchr(cp,
'\n');
91 slog(Slog::levelDebug) <<
"fifo: " << cp << std::endl;
92 if(!strnicmp(cp,
"exit", 4))
98 slog(Slog::levelWarning) <<
"server exiting..." << std::endl;
102 #ifdef CCXX_NAMESPACES
void startRunning()
Activate stack and start service thread.
This is the base session stack that will maintain all network audio activity.
void exit(const char *reason)