// Smersh // // Douglas Thrift // // $Id$ #include "Daemon.hpp" void Daemon::serve(int port, bool fork, Daemon* self) { // bind if (fork) { switch (::fork()) { case -1: cerr << program << ": fork()\n"; exit(1); case 0: break; default: return; } } // listen while (true) { // accept self->handle(); // thread } } int Daemon::handle() { // }