plebble
us::gov::id::daemon Struct Referenceabstract

#include <daemon.h>

Inheritance diagram for us::gov::id::daemon:
Collaboration diagram for us::gov::id::daemon:

Public Types

typedef socket::daemon b
 
typedef crypto::ec::keys keys
 
using datagram = socket::datagram
 
- Public Types inherited from us::gov::socket::daemon
typedef server b
 
typedef thpool pool_t
 
- Public Types inherited from us::gov::socket::server
typedef bgtask b
 
typedef crypto::ec::keys::pub_t pub_t
 

Public Member Functions

 daemon ()
 
 daemon (uint16_t port, uint16_t pport, int workers)
 
virtual ~daemon ()
 
virtual socket::clientcreate_client (int sock) override
 
virtual bool process_work (socket::peer_t *p, datagram *d) override
 
virtual const keysget_keys () const =0
 
bool is_duplicate (const pub_t &) const
 
void dump (const string &prefix, ostream &os) const
 
- Public Member Functions inherited from us::gov::socket::daemon
 daemon ()
 
 daemon (const daemon &)=delete
 
daemonoperator= (const daemon &)=delete
 
 daemon (uint16_t port, uint8_t workers)
 
 ~daemon () override
 
clientcreate_client (int sock) override
 
ko start () override
 
ko wait_ready (const chrono::system_clock::time_point &deadline) const override
 
void stop () override
 
void join () override
 
void dump (const string &prefix, ostream &os) const
 
void receive_and_process (client *) override
 
void process_work (peer_t *c)
 
virtual string homedir () const =0
 
- Public Member Functions inherited from us::gov::socket::server
 server ()
 
 server (uint16_t port)
 
virtual ~server ()
 
virtual void attach (client *)
 
virtual void attach_noupdate (client *)
 
virtual void detach (client *)
 
virtual void on_destroy (client &)
 
datagramread_from_client (int sock)
 
int make_socket (uint16_t port)
 
bool banned_throttle (const string &addr)
 
void dump (const string &prefix, ostream &os) const
 
void proc_evil (const vector< pair< uint32_t, string >> &)
 
void run ()
 
void onwakeup ()
 
ko start () override
 
ko wait_ready (const chrono::system_clock::time_point &deadline) const override
 
void stop () override
 
void join () override
 
- Public Member Functions inherited from us::gov::bgtask
 bgtask ()
 
 bgtask (function< void()> run, function< void()> onwakeup)
 
virtual ~bgtask ()
 
void set_run_function (function< void()> r)
 
void wakeup ()
 
bool isup () const
 
bool isdown () const
 
bool resumed () const
 
void run_ ()
 
void reset ()
 
bool reset_wait ()
 
bool reset_resume ()
 
bool is_active () const
 
 bgtask ()
 
 bgtask (callback cb0)
 
void set_callback (callback r)
 
ko wait_ready (Date deadline)
 
boolean reset_wait ()
 
void wakeup ()
 
boolean reset_resume ()
 
boolean isup ()
 
boolean isdown ()
 
boolean resumed ()
 
void reset ()
 
boolean is_active ()
 

Public Attributes

uint16_t pport
 
- Public Attributes inherited from us::gov::socket::daemon
pool_t pool
 
uint8_t num_workers
 
- Public Attributes inherited from us::gov::socket::server
clients_t clients
 
uint16_t port
 
int sock {0}
 
blacklist ban
 
client::queue_t sendq
 

Additional Inherited Members

- Static Public Member Functions inherited from us::gov::socket::server
static int set_not_blocking_mode (int sock)
 
- Static Public Attributes inherited from us::gov::socket::daemon
static const char * KO_4093
 
- Static Public Attributes inherited from us::gov::bgtask
static const char * KO_81021
 
static ko KO_81021 =new ko("KO 81021 Ready status never reached.")
 
- Protected Attributes inherited from us::gov::bgtask
atomic< short > resume {0}
 
thread * th {nullptr}
 
bool active {false}
 
function< void()> run
 
function< void()> onwakeup
 
mutex mx_ready
 
bool ready {false}
 
condition_variable cv_ready
 
AtomicInteger resume =new AtomicInteger(0)
 
Thread th =null
 
boolean active =false
 
callback cb =null
 
ReentrantLock mx_ready = new ReentrantLock()
 
boolean ready =false
 
Condition cv_ready =mx_ready.newCondition()
 

Member Typedef Documentation

◆ b

◆ datagram

◆ keys

Constructor & Destructor Documentation

◆ daemon() [1/2]

us::gov::id::daemon::daemon ( )

◆ daemon() [2/2]

us::gov::id::daemon::daemon ( uint16_t  port,
uint16_t  pport,
int  workers 
)

◆ ~daemon()

virtual us::gov::id::daemon::~daemon ( )
virtual

Member Function Documentation

◆ create_client()

virtual socket::client* us::gov::id::daemon::create_client ( int  sock)
overridevirtual

Reimplemented from us::gov::socket::server.

Reimplemented in us::gov::engine::networking.

◆ dump()

void us::gov::id::daemon::dump ( const string &  prefix,
ostream &  os 
) const

◆ get_keys()

virtual const keys& us::gov::id::daemon::get_keys ( ) const
pure virtual

Implemented in us::gov::engine::networking.

◆ is_duplicate()

bool us::gov::id::daemon::is_duplicate ( const pub_t ) const

◆ process_work()

virtual bool us::gov::id::daemon::process_work ( socket::peer_t p,
datagram d 
)
overridevirtual

Member Data Documentation

◆ pport

uint16_t us::gov::id::daemon::pport

The documentation for this struct was generated from the following file: