7 |
|
#ifndef _Daemon_hpp_ |
8 |
|
#define _Daemon_hpp_ |
9 |
|
|
10 |
< |
#include "Smersh.hpp" |
10 |
> |
#include <menes-api/socket.hpp> |
11 |
> |
#include <menes-api/threads.hpp> |
12 |
> |
#include <menes-etl/fnbind.hpp> |
13 |
> |
#include <menes-ios/stdadapters.hpp> |
14 |
> |
|
15 |
> |
#include "Person.hpp" |
16 |
|
|
17 |
|
class Daemon |
18 |
|
{ |
19 |
|
private: |
20 |
+ |
virtual int handle(api::TcpSocket* client); |
21 |
|
protected: |
22 |
+ |
Daemon() {} |
23 |
+ |
void serve(int port, bool fork, Daemon* self); |
24 |
|
public: |
25 |
< |
Daemon(); |
26 |
< |
virtual ~Daemon(); |
25 |
> |
Daemon(int port, bool fork) { Person::configure(); serve(port, fork, this); |
26 |
> |
} |
27 |
> |
virtual ~Daemon() {} |
28 |
|
}; |
29 |
|
|
30 |
|
#endif // _Daemon_hpp_ |