plebble
us::gov::cli::rpc_api Class Reference

#include <rpc_api.h>

Inheritance diagram for us::gov::cli::rpc_api:
Collaboration diagram for us::gov::cli::rpc_api:

Classes

class  rendezvous_t
 

Public Types

typedef gov::auth::peer_t b
 
typedef bgtask recv =new bgtask(this)
 
typedef us::gov::socket::client::queue_t queue_t
 
typedef us::gov::socket::datagram::dispatcher_t dispatcher_t
 
typedef us::gov::socket::busyled_t busyled_t
 
typedef keys::pub_t pub_t
 
- Public Types inherited from us::gov::auth::peer_t
enum  stage_t { denied =0, authorized, num_stages }
 
enum  Stage_t { Stage_t.denied = 0, Stage_t.authorized = 1, Stage_t.num_stages = 2 }
 
typedef id::peer_t b
 
- Public Types inherited from us::gov::id::peer_t
enum  stage_t {
  anonymous =0, verified, verified_fail, num_stages,
  stage_t.anonymous = 0, stage_t.verified = 1, stage_t.verified_fail = 2, stage_t.num_stages = 3
}
 
enum  role_t { role_peer =0, role_sysop =1, role_device =2, num_roles }
 
enum  stage_t {
  anonymous =0, verified, verified_fail, num_stages,
  stage_t.anonymous = 0, stage_t.verified = 1, stage_t.verified_fail = 2, stage_t.num_stages = 3
}
 
typedef socket::peer_t b
 
typedef crypto::ec::keys keys
 
typedef keys::pub_t pub_t
 
typedef pub_t::hash_t hash_t
 
using datagram = socket::datagram
 
- Public Types inherited from us::gov::socket::peer_t
typedef client b
 
- Public Types inherited from us::gov::socket::client
enum  security_level_t { security_level_ok, security_level_disconnect, security_level_ban }
 
typedef us::gov::socket::send_queue_t queue_t
 

Public Member Functions

 rpc_api (const b::keys &, const string &host, uint16_t port, role_t role, uint16_t pport_pin, dispatcher_t *)
 
 rpc_api (const b::keys &, const string &host, uint16_t port, role_t role, uint16_t pport_pin, dispatcher_t *, queue_t *sendq)
 
 ~rpc_api () override
 
const keysget_keys () const override
 
bool authorize (const pub_t &p, uint16_t pin) const override
 
ko connect (uint16_t pport_pin, ostream *)
 
std::pair< ko, datagram * > sendrecv (datagram *)
 
ko send1 (datagram *) override
 
void wait (const chrono::system_clock::time_point &deadline)
 
virtual queue_tcreate_sendq ()
 
void on_peer_disconnected (const string &reason) override
 
void on_connect (ko) override
 
ko start () override
 
ko wait_ready (const chrono::system_clock::time_point &deadline) const override
 
void stop () override
 
void join () override
 
bool is_active () const
 
void run_recv ()
 
void onwakeup ()
 
ko wait_connected ()
 
ko wait_connection (bool initiate)
 
bool is_connected () const
 
void string_dgram (const datagram &)
 
void process_work (datagram *)
 
void set_busy_handlers (busyled_t::handler_t *hsend, busyled_t::handler_t *hrecv)
 
 rpc_api (KeyPair k, String host_, uint16_t port_, role_t role_, uint16_t pin_, datagram.dispatcher_t dis)
 
 rpc_api (KeyPair k, String host_, uint16_t port_, role_t role_, uint16_t pin_, datagram.dispatcher_t dis, send_queue sendq_)
 
void constructor (KeyPair k, String host_, uint16_t port_, role_t role_, uint16_t pin_, datagram.dispatcher_t dis, send_queue sendq_)
 
void destroy ()
 
ko start ()
 
ko wait_ready (Date deadline)
 
void stop ()
 
void join ()
 
send_queue create_sendq ()
 
pair< ko, datagramsendrecv (datagram d)
 
ko wait_connected ()
 
ko wait_connection (boolean initiate)
 
void run_body ()
 
void onwakeup ()
 
boolean is_active ()
 
ko send1 (datagram d)
 
void on_connect (ko error)
 
void on_peer_disconnected (final String reason)
 
void process_work2 (datagram d)
 
KeyPair get_keys ()
 
boolean authorize (PublicKey p)
 
void set_busy_handlers (busyled_t.handler_t hsend, busyled_t.handler_t hrecv)
 
- Public Member Functions inherited from us::gov::auth::peer_t
 peer_t (int sock=-1)
 
 ~peer_t () override
 
void verification_completed (uint16_t rpport) override
 
virtual bool authorize (const pub_t &p, uint16_t pin) const =0
 
void dump_all (const string &prefix, ostream &os) const override
 
void dump (const string &prefix, ostream &os) const
 
 peer_t (Socket sock)
 
override void verification_completed ()
 
virtual bool authorize (byte[] pub)
 
 peer_t (Socket sock)
 
void verification_completed (uint16_t rpport)
 
- Public Member Functions inherited from us::gov::id::peer_t
 peer_t (int sock)
 
ko connect (const string &host, uint16_t port, uint16_t pport, role_t, bool block)
 
virtual ko connect (uint32_t host, uint16_t port, uint16_t pport, role_t, bool block)
 
virtual void verification_completed (uint16_t rpport)
 
void dump (const string &prefix, ostream &os) const
 
bool process_work (datagram *d)
 
void process_request (datagram *d, const keys &)
 
void process_peer_challenge (datagram *d, const keys &)
 
void process_challenge_response (datagram *d)
 
ko initiate_dialogue (role_t role, uint16_t pport_pin)
 
bool verification_is_fine () const
 
string short_version () const
 
ko turn_on_encryption ()
 
ko wait_auth () const
 
pair< ko, datagram * > encrypt0 (datagram *) const override
 
pair< ko, datagram * > decrypt0 (datagram *) const override
 
void disconnect (uint16_t seq, const string &reason) override
 
stage_t get_stage_peer () const
 
void set_stage_peer (stage_t)
 
daemonget_parent ()
 
const daemonget_parent () const
 
bool is_role_peer () const
 
bool is_role_sysop () const
 
bool is_role_device () const
 
 peer_t (Socket sock)
 
String connect (String host, int port, char role, bool block)
 
override bool process_work (datagram d)
 
void process_request (datagram d, KeyPair mykeys)
 
void process_peer_challenge (datagram d, KeyPair mykeys)
 
void process_challenge_response (datagram d)
 
void initiate_dialogue (char role)
 
bool verification_is_fine ()
 
String run_auth_responder ()
 
ko connect (String host, uint16_t port, uint16_t pport_pin, role_t role, boolean block)
 
ko connect (String endpoint, uint16_t pport_pin, role_t role, boolean block)
 
boolean process_work (datagram d)
 
ko initiate_dialogue (role_t role, uint16_t pport)
 
void process_request (datagram d, KeyPair mykeys)
 
void process_peer_challenge (datagram d, KeyPair mykeys)
 
void process_challenge_response (datagram d)
 
ko turn_on_encryption ()
 
pair< ko, datagramencrypt0 (datagram d)
 
pair< ko, datagramdecrypt0 (datagram e)
 
boolean verification_is_fine ()
 
void verification_completed (uint16_t rpport)
 
ko wait_auth ()
 
- Public Member Functions inherited from us::gov::socket::peer_t
 peer_t ()
 
 peer_t (int sock)
 
 peer_t (const peer_t &)=delete
 
peer_toperator= (const peer_t &)=delete
 
 ~peer_t () override
 
void dump_all (const string &prefix, ostream &os) const override
 
pair< security_level_t, string > security_level () const override
 
bool stalled_datagram () const
 
bool process_work (datagram *d)
 
void dump (const string &prefix, ostream &os) const
 
 peer_t ()
 
 peer_t (Socket sock)
 
bool is_slow ()
 
bool ping ()
 
void process_pong ()
 
 peer_t ()
 
- Public Member Functions inherited from us::gov::socket::client
 client ()
 
 client (int sock)
 
virtual ~client ()
 
ko connect0 (uint32_t host, uint16_t port, bool block)
 
ko connect0 (const string &host, uint16_t port, bool block)
 
bool connected () const
 
pair< uint32_t, uint16_t > raddress () const
 
pair< ko, datagram * > recv4x (datagram *d)
 
pair< ko, datagram * > recv6 ()
 
ko init_sock2 (uint32_t host, uint16_t port, bool block)
 
void dump (const string &prefix, ostream &os) const
 
string refdata () const
 
string endpoint () const
 
void prepare_worker_recv ()
 
void worker_ended_recv ()
 
void set_finished ()
 
bool is_finished () const
 
void test_alive ()
 
void ping ()
 
 client ()
 
 client (Socket sock_)
 
String connect0 (String host, int port)
 
String connect0 (String host, int port, bool block)
 
void disconnect ()
 
bool connected ()
 
bool IsConnected ()
 
String address ()
 
void ready ()
 
pair< String, datagramsend_recv3 (datagram d)
 
pair< String, datagramrecv6 ()
 
pair< String, datagramrecv3 ()
 
pair< String, datagramrecv4 (datagram d)
 
String send3 (datagram d)
 
 client ()
 
 client (Socket sock_)
 
void prepare_worker_recv ()
 
void worker_ended_recv ()
 
ko connect0 (String host, uint16_t port)
 
ko connect0 (String host, uint16_t hport, boolean block)
 
void disconnect (uint16_t seq, String reason)
 
boolean connected ()
 
String address ()
 
String endpoint ()
 
pair< ko, datagramrecv6 ()
 
pair< ko, datagramrecv4x (datagram d)
 
boolean is_finished ()
 
void dump (String prefix, PrintStream os)
 
void test_alive ()
 
- 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)
 
void run ()
 
boolean reset_wait ()
 
void wakeup ()
 
boolean reset_resume ()
 
boolean isup ()
 
boolean isdown ()
 
boolean resumed ()
 
void reset ()
 

Public Attributes

condition_variable cv_recv
 
condition_variable cv_connected
 
string host
 
uint16_t port
 
keys id
 
chrono::system_clock::time_point connected_since
 
bool ownsendq
 
role_t role
 
uint16_t pport_pin
 
bool connect_for_recv {true}
 
bool stop_on_disconnection {true}
 
mutex mx_connect
 
rendezvous_t rendezvous =new rendezvous_t()
 
stack< ostream * > cinfo
 
dispatcher_tdispatcher
 
busyled_t busyled_recv =new busyled_t()
 
int ms {10000}
 
chrono::system_clock::time_point last_try_connect {chrono::system_clock::now()-chrono::milliseconds(ms)}
 
boolean connect_for_recv =true
 
boolean stop_on_disconnection =true
 
Stack< PrintStream > cinfo =new Stack<PrintStream>()
 
- Public Attributes inherited from us::gov::auth::peer_t
stage_t stage {denied}
 
Stage_t stage = Stage_t.denied
 
String[] stagestr = {"denied", "authorized"}
 
- Public Attributes inherited from us::gov::id::peer_t
stage_t stage_peer {anonymous}
 
handshakes_thandshakes {nullptr}
 
role_t role {role_peer}
 
pub_t pubkey
 
uint16_t version_fingerprint {0}
 
mutex mx_auth
 
condition_variable cv_auth
 
crypto::symmetric_encryptionse {nullptr}
 
byte[] pubkey
 
PublicKey pubkey =null
 
- Public Attributes inherited from us::gov::socket::peer_t
datagramcurd {nullptr}
 
mutex mx_curd
 
- Public Attributes inherited from us::gov::socket::client
chrono::system_clock::time_point since
 
chrono::system_clock::time_point activity_recv
 
chrono::system_clock::time_point last_test_alive
 
atomic< uint64_t > activity
 
atomic< int > busyrecv {0}
 
int sock =null
 
uint32_t address
 
uint16_t port
 
atomic< int > sendref {0}
 
serverparent {nullptr}
 
queue_tsendq {nullptr}
 
pair< uint16_t, string > finished_reason
 
atomic< bool > finished {false}
 
Socket sock =null
 
long since
 
send_queue sendq =null
 
AtomicInteger sendref =new AtomicInteger(0)
 
long uid =++prev_uid
 

Static Public Attributes

static const char * KO_40928
 
static const char * KO_10210
 
static const char * KO_3029
 
static ko KO_3029 =new ko("KO 3029.2 Timeout")
 
static ko KO_40928 =new ko("KO 40928 Unable to parse response datagram.")
 
- Static Public Attributes inherited from us::gov::auth::peer_t
constexpr static array< const char *, num_stagesstagestr ={"denied","authorized"}
 
- Static Public Attributes inherited from us::gov::id::peer_t
static const char * KO_6017
 
constexpr static array< const char *, num_stagesstagestr ={"anonymous","verified","verified_fail"}
 
constexpr static array< const char *, num_rolesrolestr ={"peer","sysop","device"}
 
static ko KO_6017 =new ko("KO 6017 authentication failed.")
 
static final String[] stagestr = {"anonymous","verified","verified_fail"}
 
static final ko KO_43823 =new ko("KO 43823 Invalid endpoint")
 
- Static Public Attributes inherited from us::gov::socket::peer_t
constexpr static chrono::seconds stall {5s}
 
static const char * finished_reason_1
 
static const char * finished_reason_2
 
- Static Public Attributes inherited from us::gov::socket::client
static const char * KO_7190
 
static const char * KO_58961
 
static const char * KO_60541
 
static const char * KO_10100
 
static const char * KO_20190
 
static const char * KO_20191
 
static busyled_t busyled_recv =new busyled_t()
 
static struct timeval timeout
 
static final ko KO_58961 =new ko("KO 58961 Invalid port.")
 
static final ko KO_83911 =new ko("KO 83911 IO Exception.")
 
static final ko KO_83912 =new ko("KO 83912 Exception.")
 
static final ko KO_10100 =new ko("KO 10100 Unreachable host.")
 
static final ko KO_20190 =new ko("KO 20190 Invalid endpoint port.")
 
static final ko KO_20191 =new ko("KO 20191 Invalid endpoint host.")
 
static long prev_uid =0
 
- 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.")
 

Package Functions

void wait (Date deadline)
 
boolean is_connected ()
 
ko connect (uint16_t pport_pin, PrintStream os)
 
- Package Functions inherited from us::gov::id::peer_t
boolean is_role_peer ()
 
boolean is_role_sysop ()
 
boolean is_role_device ()
 
void set_stage_peer (stage_t s)
 
stage_t get_stage_peer ()
 
String short_version ()
 
- Package Functions inherited from us::gov::socket::client
String refdata ()
 
void set_finished ()
 

Package Attributes

ReentrantLock lock_recv =new ReentrantLock()
 
Condition cv_recv =lock_recv.newCondition()
 
ReentrantLock lock_connect =new ReentrantLock()
 
Condition cv_connected =lock_connect.newCondition()
 
String host
 
KeyPair id
 
long connected_since
 
boolean ownsendq
 
datagram.dispatcher_t dispatcher
 
Date last_try_connect =new Date(System.currentTimeMillis()-ms)
 
- Package Attributes inherited from us::gov::id::peer_t
uint16_t daemon_pport =uint16_t.zero
 
handshakes_t handshakes =null
 
ReentrantLock mx_auth = new ReentrantLock()
 
Condition cv_auth =mx_auth.newCondition()
 
symmetric_encryption se =null
 
- Package Attributes inherited from us::gov::socket::client
pair< uint16_t, String > finished_reason =new pair<uint16_t, String>(new uint16_t(0), "")
 
AtomicBoolean finished =new AtomicBoolean(false)
 
AtomicInteger busyrecv =new AtomicInteger(0)
 
boolean called_disconnect =false
 
long activity_recv
 
long last_test_alive
 
AtomicLong activity =new AtomicLong(0L)
 

Static Package Attributes

static datagram waiting_arrival =new datagram(0)
 

Additional Inherited Members

- Static Public Member Functions inherited from us::gov::id::peer_t
static string to_string (const vector< unsigned char > &data)
 
static String get_random_message ()
 
- Static Public Member Functions inherited from us::gov::socket::client
static uint32_t host2addr (const string &host)
 
static string age (uint64_t msts)
 
static string age (chrono::system_clock::time_point time)
 
static string ip4_decode (uint32_t addr)
 
static uint32_t ip4_encode (const string &addr)
 
static bool is_wan_ip (uint32_t)
 
static bool is_valid_ip (uint32_t)
 
static string endpoint (uint32_t addr, uint16_t port)
 
static string endpoint (const pair< uint32_t, uint16_t > &ip)
 
static pair< ko, pair< string, uint16_t > > parse_endpoint (const string &ipport)
 
static pair< ko, pair< String, Short > > parse_endpoint (String ipport)
 
static String ip4_decode (uint32_t addr0)
 
static uint32_t ip4_encode (String addr0)
 
static String endpoint (uint32_t a, uint16_t p)
 
static String endpoint (String a, uint16_t p)
 
- 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

◆ busyled_t

◆ dispatcher_t

◆ pub_t

◆ queue_t

◆ recv

Constructor & Destructor Documentation

◆ rpc_api() [1/4]

us::gov::cli::rpc_api::rpc_api ( const b::keys ,
const string &  host,
uint16_t  port,
role_t  role,
uint16_t  pport_pin,
dispatcher_t  
)

◆ rpc_api() [2/4]

us::gov::cli::rpc_api::rpc_api ( const b::keys ,
const string &  host,
uint16_t  port,
role_t  role,
uint16_t  pport_pin,
dispatcher_t ,
queue_t sendq 
)

◆ ~rpc_api()

us::gov::cli::rpc_api::~rpc_api ( )
override

◆ rpc_api() [3/4]

us.gov.cli.rpc_api.rpc_api ( KeyPair  k,
String  host_,
uint16_t  port_,
role_t  role_,
uint16_t  pin_,
datagram.dispatcher_t  dis 
)
inline

References constructor(), create_sendq(), and ownsendq.

Here is the call graph for this function:

◆ rpc_api() [4/4]

us.gov.cli.rpc_api.rpc_api ( KeyPair  k,
String  host_,
uint16_t  port_,
role_t  role_,
uint16_t  pin_,
datagram.dispatcher_t  dis,
send_queue  sendq_ 
)
inline

References constructor(), and ownsendq.

Here is the call graph for this function:

Member Function Documentation

◆ authorize() [1/2]

bool us::gov::cli::rpc_api::authorize ( const pub_t p,
uint16_t  pin 
) const
inlineoverride

◆ authorize() [2/2]

boolean us.gov.cli.rpc_api.authorize ( PublicKey  p)
inline

Reimplemented from us::gov::auth::peer_t.

◆ connect() [1/2]

ko us::gov::cli::rpc_api::connect ( uint16_t  pport_pin,
ostream *   
)

Referenced by wait_connection().

Here is the caller graph for this function:

◆ connect() [2/2]

ko us.gov.cli.rpc_api.connect ( uint16_t  pport_pin,
PrintStream  os 
)
inlinepackage

References connected_since, cv_connected, host, us.ko.is_ko(), lock_connect, port, pport_pin, role, and us::gov::socket::client.sock.

Here is the call graph for this function:

◆ constructor()

void us.gov.cli.rpc_api.constructor ( KeyPair  k,
String  host_,
uint16_t  port_,
role_t  role_,
uint16_t  pin_,
datagram.dispatcher_t  dis,
send_queue  sendq_ 
)
inline

References dispatcher, host, port, pport_pin, role, and us::gov::socket::client.sendq.

Referenced by rpc_api().

Here is the caller graph for this function:

◆ create_sendq() [1/2]

virtual queue_t* us::gov::cli::rpc_api::create_sendq ( )
virtual

Referenced by rpc_api().

Here is the caller graph for this function:

◆ create_sendq() [2/2]

send_queue us.gov.cli.rpc_api.create_sendq ( )
inline

◆ destroy()

void us.gov.cli.rpc_api.destroy ( )
inline

References join().

Referenced by us.wallet.daemon.rpc_api.destroy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_keys() [1/2]

KeyPair us.gov.cli.rpc_api.get_keys ( )
inlinevirtual

Reimplemented from us::gov::id::peer_t.

References id.

◆ get_keys() [2/2]

const keys& us::gov::cli::rpc_api::get_keys ( ) const
inlineoverridevirtual

Reimplemented from us::gov::id::peer_t.

◆ is_active() [1/2]

boolean us.gov.cli.rpc_api.is_active ( )
inline

Reimplemented from us::gov::bgtask.

References us::gov::bgtask.is_active(), and us::gov::socket::client.sendq.

Here is the call graph for this function:

◆ is_active() [2/2]

bool us::gov::cli::rpc_api::is_active ( ) const

Referenced by us.wallet.daemon.rpc_api::is_active(), and send1().

Here is the caller graph for this function:

◆ is_connected() [1/2]

boolean us.gov.cli.rpc_api.is_connected ( )
inlinepackage

References lock_connect.

◆ is_connected() [2/2]

bool us::gov::cli::rpc_api::is_connected ( ) const

Referenced by wait_connected(), and wait_connection().

Here is the caller graph for this function:

◆ join() [1/2]

void us.gov.cli.rpc_api.join ( )
inlinevirtual

Reimplemented from us::gov::bgtask.

References us::gov::bgtask.join(), ownsendq, and us::gov::socket::client.sendq.

Here is the call graph for this function:

◆ join() [2/2]

void us::gov::cli::rpc_api::join ( )
overridevirtual

Reimplemented from us::gov::bgtask.

Referenced by destroy(), and us.wallet.daemon.rpc_api::join().

Here is the caller graph for this function:

◆ on_connect() [1/2]

void us.gov.cli.rpc_api.on_connect ( ko  error)
inlinevirtual

Reimplemented from us::gov::socket::client.

Reimplemented in us.wallet.daemon.rpc_api.endpoint_t, and us::gov::cli::hmi::rpc_api.

References us.ko.is_ko().

Here is the call graph for this function:

◆ on_connect() [2/2]

void us::gov::cli::rpc_api::on_connect ( ko  )
overridevirtual

Reimplemented from us::gov::socket::client.

Reimplemented in us.wallet.daemon.rpc_api.endpoint_t.

◆ on_peer_disconnected() [1/2]

void us::gov::cli::rpc_api::on_peer_disconnected ( const string &  reason)
overridevirtual

Reimplemented from us::gov::socket::peer_t.

◆ on_peer_disconnected() [2/2]

void us.gov.cli.rpc_api.on_peer_disconnected ( final String  reason)
inline

Reimplemented from us::gov::socket::peer_t.

Reimplemented in us.wallet.daemon.rpc_api.endpoint_t.

References cinfo, stop(), and stop_on_disconnection.

Here is the call graph for this function:

◆ onwakeup() [1/2]

void us::gov::cli::rpc_api::onwakeup ( )

◆ onwakeup() [2/2]

void us.gov.cli.rpc_api.onwakeup ( )
inline

◆ process_work()

void us::gov::cli::rpc_api::process_work ( datagram )

◆ process_work2()

void us.gov.cli.rpc_api.process_work2 ( datagram  d)
inline

References us::gov::cli::rpc_api::rendezvous_t.arrived(), us::gov::socket::datagram::dispatcher_t.dispatch(), dispatcher, and rendezvous.

Referenced by run_body().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_body()

◆ run_recv()

void us::gov::cli::rpc_api::run_recv ( )

◆ send1() [1/2]

ko us::gov::cli::rpc_api::send1 ( datagram )
overridevirtual

Reimplemented from us::gov::socket::client.

◆ send1() [2/2]

◆ sendrecv() [1/2]

◆ sendrecv() [2/2]

pair<ko, datagram> us.gov.cli.rpc_api.sendrecv ( datagram  d)
inline

References rendezvous, and us::gov::cli::rpc_api::rendezvous_t.sendrecv().

Here is the call graph for this function:

◆ set_busy_handlers() [1/2]

void us.gov.cli.rpc_api.set_busy_handlers ( busyled_t.handler_t  hsend,
busyled_t.handler_t  hrecv 
)
inline

◆ set_busy_handlers() [2/2]

void us::gov::cli::rpc_api::set_busy_handlers ( busyled_t::handler_t hsend,
busyled_t::handler_t hrecv 
)

Referenced by us.wallet.daemon.rpc_api::set_busy_handlers().

Here is the caller graph for this function:

◆ start() [1/2]

ko us.gov.cli.rpc_api.start ( )
inlinevirtual

◆ start() [2/2]

ko us::gov::cli::rpc_api::start ( )
overridevirtual

Reimplemented from us::gov::bgtask.

Referenced by us.wallet.daemon.rpc_api::start().

Here is the caller graph for this function:

◆ stop() [1/2]

void us.gov.cli.rpc_api.stop ( )
inlinevirtual

◆ stop() [2/2]

void us::gov::cli::rpc_api::stop ( )
overridevirtual

Reimplemented from us::gov::bgtask.

Referenced by on_peer_disconnected(), run_body(), and us.wallet.daemon.rpc_api::stop().

Here is the caller graph for this function:

◆ string_dgram()

void us::gov::cli::rpc_api::string_dgram ( const datagram )

◆ wait() [1/2]

void us::gov::cli::rpc_api::wait ( const chrono::system_clock::time_point &  deadline)

Referenced by wait_connection().

Here is the caller graph for this function:

◆ wait() [2/2]

void us.gov.cli.rpc_api.wait ( Date  deadline)
inlinepackage

References cv_connected, and lock_connect.

◆ wait_connected() [1/2]

ko us::gov::cli::rpc_api::wait_connected ( )

Referenced by wait_connection().

Here is the caller graph for this function:

◆ wait_connected() [2/2]

ko us.gov.cli.rpc_api.wait_connected ( )
inline

References cv_connected, is_connected(), us::gov::bgtask.isup(), lock_connect, and us.ok.

Here is the call graph for this function:

◆ wait_connection() [1/2]

ko us::gov::cli::rpc_api::wait_connection ( bool  initiate)

Referenced by run_body(), and send1().

Here is the caller graph for this function:

◆ wait_connection() [2/2]

ko us.gov.cli.rpc_api.wait_connection ( boolean  initiate)
inline

References cinfo, connect(), is_connected(), us.ko.is_ko(), last_try_connect, ms, us.ok, pport_pin, wait(), and wait_connected().

Here is the call graph for this function:

◆ wait_ready() [1/2]

ko us::gov::cli::rpc_api::wait_ready ( const chrono::system_clock::time_point &  deadline) const
overridevirtual

Reimplemented from us::gov::bgtask.

Referenced by us.wallet.daemon.rpc_api::wait_ready().

Here is the caller graph for this function:

◆ wait_ready() [2/2]

ko us.gov.cli.rpc_api.wait_ready ( Date  deadline)
inline

Reimplemented from us::gov::bgtask.

References us.ko.is_ko(), ownsendq, us::gov::socket::client.sendq, and us::gov::bgtask.wait_ready().

Here is the call graph for this function:

Member Data Documentation

◆ busyled_recv

busyled_t us::gov::cli::rpc_api::busyled_recv =new busyled_t()

Referenced by set_busy_handlers().

◆ cinfo [1/2]

◆ cinfo [2/2]

Stack<PrintStream> us.gov.cli.rpc_api.cinfo =new Stack<PrintStream>()

◆ connect_for_recv [1/2]

bool us::gov::cli::rpc_api::connect_for_recv {true}

◆ connect_for_recv [2/2]

boolean us.gov.cli.rpc_api.connect_for_recv =true

◆ connected_since [1/2]

chrono::system_clock::time_point us::gov::cli::rpc_api::connected_since

Referenced by connect().

◆ connected_since [2/2]

long us.gov.cli.rpc_api.connected_since
package

◆ cv_connected [1/2]

condition_variable us::gov::cli::rpc_api::cv_connected

Referenced by connect(), stop(), wait(), and wait_connected().

◆ cv_connected [2/2]

Condition us.gov.cli.rpc_api.cv_connected =lock_connect.newCondition()
package

◆ cv_recv [1/2]

condition_variable us::gov::cli::rpc_api::cv_recv

Referenced by stop().

◆ cv_recv [2/2]

Condition us.gov.cli.rpc_api.cv_recv =lock_recv.newCondition()
package

◆ dispatcher [1/2]

dispatcher_t* us::gov::cli::rpc_api::dispatcher

Referenced by constructor(), and process_work2().

◆ dispatcher [2/2]

datagram.dispatcher_t us.gov.cli.rpc_api.dispatcher
package

◆ host [1/2]

string us::gov::cli::rpc_api::host

Referenced by connect(), and constructor().

◆ host [2/2]

String us.gov.cli.rpc_api.host
package

◆ id [1/2]

keys us::gov::cli::rpc_api::id

Referenced by get_keys().

◆ id [2/2]

KeyPair us.gov.cli.rpc_api.id
package

◆ KO_10210

const char* us::gov::cli::rpc_api::KO_10210
static

◆ KO_3029 [1/2]

const char* us::gov::cli::rpc_api::KO_3029
static

◆ KO_3029 [2/2]

ko us.gov.cli.rpc_api.KO_3029 =new ko("KO 3029.2 Timeout")
static

◆ KO_40928 [1/2]

const char* us::gov::cli::rpc_api::KO_40928
static

Referenced by us.wallet.wallet.rpc_api::add_address(), us.wallet.daemon.rpc_api::allw(), us.wallet.wallet.rpc_api::balance(), us.wallet.wallet.rpc_api::compilance_report(), us.wallet.wallet.rpc_api::decrypt(), us.wallet.wallet.rpc_api::encrypt(), us.wallet.wallet.rpc_api::file(), us.wallet.wallet.rpc_api::gen_keys(), us.wallet.daemon.rpc_api::get_component_update(), us.wallet.wallet.rpc_api::get_subhome(), us.wallet.daemon.rpc_api::harvest(), us.wallet.wallet.rpc_api::kill_trade(), us.wallet.wallet.rpc_api::list(), us.wallet.pairing.rpc_api::list_devices(), us.wallet.wallet.rpc_api::list_protocols(), us.wallet.wallet.rpc_api::list_trades(), us.wallet.daemon.rpc_api::list_wallets(), us.wallet.wallet.rpc_api::new_address(), us.wallet.wallet.rpc_api::node_pkh(), us.wallet.pairing.rpc_api::pair_device(), us.wallet.wallet.rpc_api::patch_os(), us.wallet.daemon.rpc_api::ping(), us.wallet.pairing.rpc_api::prepair_device(), us.wallet.daemon.rpc_api::print_grid(), us.wallet.wallet.rpc_api::priv_key(), us.wallet.wallet.rpc_api::pub_key(), us.wallet.daemon.rpc_api::reload_file(), us.wallet.wallet.rpc_api::rm_file(), us.wallet.wallet.rpc_api::rm_kv(), us.wallet.wallet.rpc_api::search(), us.wallet.wallet.rpc_api::set_supply(), us.wallet.wallet.rpc_api::sign(), us.wallet.wallet.rpc_api::store_file(), us.wallet.wallet.rpc_api::store_kv(), us.wallet.daemon.rpc_api::sync(), us.wallet.wallet.rpc_api::trade(), us.wallet.wallet.rpc_api::traders_api_exec(), us.wallet.wallet.rpc_api::traders_api_list(), us.wallet.wallet.rpc_api::transfer(), us.wallet.wallet.rpc_api::transfer_from(), us.wallet.wallet.rpc_api::tx_add_input(), us.wallet.wallet.rpc_api::tx_add_output(), us.wallet.wallet.rpc_api::tx_add_section(), us.wallet.wallet.rpc_api::tx_charge_pay(), us.wallet.wallet.rpc_api::tx_check(), us.wallet.wallet.rpc_api::tx_decode(), us.wallet.wallet.rpc_api::tx_make_p2pkh(), us.wallet.wallet.rpc_api::tx_new(), us.wallet.wallet.rpc_api::tx_pay(), us.wallet.wallet.rpc_api::tx_send(), us.wallet.wallet.rpc_api::tx_sign(), us.wallet.pairing.rpc_api::unpair_device(), us.wallet.pairing.rpc_api::unprepair_device(), and us.wallet.wallet.rpc_api::verify().

◆ KO_40928 [2/2]

ko us.gov.cli.rpc_api.KO_40928 =new ko("KO 40928 Unable to parse response datagram.")
static

◆ last_try_connect [1/2]

chrono::system_clock::time_point us::gov::cli::rpc_api::last_try_connect {chrono::system_clock::now()-chrono::milliseconds(ms)}

Referenced by wait_connection().

◆ last_try_connect [2/2]

Date us.gov.cli.rpc_api.last_try_connect =new Date(System.currentTimeMillis()-ms)
package

◆ lock_connect

ReentrantLock us.gov.cli.rpc_api.lock_connect =new ReentrantLock()
package

◆ lock_recv

ReentrantLock us.gov.cli.rpc_api.lock_recv =new ReentrantLock()
package

Referenced by stop().

◆ ms

int us::gov::cli::rpc_api::ms {10000}

Referenced by wait_connection().

◆ mx_connect

mutex us::gov::cli::rpc_api::mx_connect
mutable

◆ ownsendq [1/2]

bool us::gov::cli::rpc_api::ownsendq

◆ ownsendq [2/2]

boolean us.gov.cli.rpc_api.ownsendq
package

◆ port

uint16_t us::gov::cli::rpc_api::port

Referenced by connect(), and constructor().

◆ pport_pin

uint16_t us::gov::cli::rpc_api::pport_pin

◆ rendezvous

rendezvous_t us::gov::cli::rpc_api::rendezvous =new rendezvous_t()

Referenced by process_work2(), sendrecv(), and stop().

◆ role

role_t us::gov::cli::rpc_api::role

Referenced by connect(), and constructor().

◆ stop_on_disconnection [1/2]

bool us::gov::cli::rpc_api::stop_on_disconnection {true}

◆ stop_on_disconnection [2/2]

boolean us.gov.cli.rpc_api.stop_on_disconnection =true

◆ waiting_arrival

datagram us.gov.cli.rpc_api.waiting_arrival =new datagram(0)
staticpackage

The documentation for this class was generated from the following files: