|
plebble
|
#include <daemon.h>


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::client * | create_client (int sock) override |
| virtual bool | process_work (socket::peer_t *p, datagram *d) override |
| virtual const keys & | get_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 | |
| daemon & | operator= (const daemon &)=delete |
| daemon (uint16_t port, uint8_t workers) | |
| ~daemon () override | |
| client * | create_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 &) |
| datagram * | read_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() |
| typedef socket::daemon us::gov::id::daemon::b |
| us::gov::id::daemon::daemon | ( | ) |
| us::gov::id::daemon::daemon | ( | uint16_t | port, |
| uint16_t | pport, | ||
| int | workers | ||
| ) |
|
virtual |
Reimplemented in us::gov::relay::daemon, us::gov::peer::daemon, and us::gov::dfs::daemon.
|
overridevirtual |
Reimplemented from us::gov::socket::server.
Reimplemented in us::gov::engine::networking.
| void us::gov::id::daemon::dump | ( | const string & | prefix, |
| ostream & | os | ||
| ) | const |
|
pure virtual |
Implemented in us::gov::engine::networking.
| bool us::gov::id::daemon::is_duplicate | ( | const pub_t & | ) | const |
|
overridevirtual |
Reimplemented from us::gov::socket::daemon.
Reimplemented in us::gov::peer::daemon, us::gov::relay::daemon, us::gov::engine::networking, and us::gov::dfs::daemon.
| uint16_t us::gov::id::daemon::pport |