feisty meow concerns codebase
2.140
|
#include <cromp_client.h>
Public Types | |
enum | constraints { DEFAULT_MAX_CONNECT_WAIT = 28 * basis::SECOND_ms , DEFAULT_MAX_RESPONSE_WAIT = 4 * basis::MINUTE_ms } |
Public Types inherited from cromp::cromp_common | |
enum | outcomes { OKAY = basis::common::OKAY , DISALLOWED = basis::common::DISALLOWED , BAD_INPUT = basis::common::BAD_INPUT , NOT_FOUND = basis::common::NOT_FOUND , TIMED_OUT = basis::common::TIMED_OUT , GARBAGE = basis::common::GARBAGE , NO_HANDLER = basis::common::NO_HANDLER , PARTIAL = basis::common::PARTIAL , ENCRYPTION_MISMATCH = basis::common::ENCRYPTION_MISMATCH , NO_SERVER = sockets::communication_commons::NO_SERVER , NO_CONNECTION = sockets::communication_commons::NO_CONNECTION } |
Static Public Member Functions | |
static const basis::byte_array & | blank_verification () |
Static Public Member Functions inherited from cromp::cromp_common | |
static int | default_port () |
static const char * | outcome_name (const basis::outcome &to_name) |
static basis::astring | chew_hostname (const sockets::internet_address &addr, sockets::internet_address *resolved=NULL_POINTER) |
static double | total_bytes_sent () |
static double | total_bytes_received () |
static bool | decode_host (const basis::astring &coded_host, basis::astring &hostname, sockets::machine_uid &machine) |
static const crypto::rsa_crypto & | localhost_only_key () |
Friends | |
class | asynch_connection_thread |
Additional Inherited Members | |
Static Public Attributes inherited from cromp::cromp_common | |
static const int | HOSTCHOP = 6 |
Protected Member Functions inherited from cromp::cromp_common | |
octopi::octopus * | singleton () const |
Definition at line 44 of file cromp_client.h.
Enumerator | |
---|---|
DEFAULT_MAX_CONNECT_WAIT | |
DEFAULT_MAX_RESPONSE_WAIT |
Definition at line 47 of file cromp_client.h.
cromp::cromp_client::cromp_client | ( | const sockets::internet_address & | destination, |
int | connection_wait = DEFAULT_MAX_CONNECT_WAIT , |
||
int | max_per_ent = DEFAULT_MAX_ENTITY_QUEUE |
||
) |
Definition at line 125 of file cromp_client.cpp.
References cromp::cromp_common::add_tentacle(), FUNCDEF, LOG, octopi::octopus_entity::mangled_form(), and cromp::cromp_common::open_common().
|
virtual |
Definition at line 155 of file cromp_client.cpp.
References cromp::cromp_common::close_common(), disconnect(), FUNCDEF, and basis::WHACK().
outcome cromp::cromp_client::acquire | ( | octopi::infoton *& | response, |
const octopi::octopus_request_id & | cmd_id, | ||
int | timeout = DEFAULT_MAX_RESPONSE_WAIT |
||
) |
Definition at line 581 of file cromp_client.cpp.
References octopi::unhandled_request::_reason, CHECK_LOCKOUT, decrypt_package_as_needed(), FUNCDEF, LOG, cromp::cromp_common::outcome_name(), and cromp::cromp_common::retrieve_and_restore().
Referenced by synchronous_request().
outcome cromp::cromp_client::acquire_any | ( | octopi::infoton *& | response, |
octopi::octopus_request_id & | cmd_id, | ||
int | timeout = DEFAULT_MAX_RESPONSE_WAIT |
||
) |
Definition at line 601 of file cromp_client.cpp.
References octopi::unhandled_request::_reason, CHECK_LOCKOUT, decrypt_package_as_needed(), FUNCDEF, and cromp::cromp_common::retrieve_and_restore_any().
outcome cromp::cromp_client::asynch_connect | ( | ) |
Definition at line 408 of file cromp_client.cpp.
References asynch_connection_thread, AUTO_LOCK, connected(), FUNCDEF, instance_name(), LOG, cromp::cromp_common::NO_CONNECTION, NULL_POINTER, and cromp::cromp_common::OKAY.
|
static |
Definition at line 287 of file cromp_client.cpp.
outcome cromp::cromp_client::connect | ( | const basis::byte_array & | verification = blank_verification() | ) |
Definition at line 399 of file cromp_client.cpp.
References AUTO_LOCK, FUNCDEF, and verification().
bool cromp::cromp_client::connected | ( | ) | const |
Definition at line 171 of file cromp_client.cpp.
References sockets::spocket::connected(), and cromp::cromp_common::spock().
Referenced by asynch_connect().
void cromp::cromp_client::decrypt_package_as_needed | ( | basis::outcome & | to_return, |
octopi::infoton *& | response, | ||
const octopi::octopus_request_id & | cmd_id | ||
) |
Definition at line 622 of file cromp_client.cpp.
References octopi::encryption_tentacle::consume(), cromp::cromp_common::ENCRYPTION_MISMATCH, FUNCDEF, LOG, NULL_POINTER, cromp::cromp_common::octo(), cromp::cromp_common::OKAY, cromp::cromp_common::PARTIAL, octopi::octopus::restore(), octopi::octopus_request_id::text_form(), and basis::WHACK().
Referenced by acquire(), and acquire_any().
cromp::cromp_client::DEFINE_CLASS_NAME | ( | "cromp_client" | ) |
outcome cromp::cromp_client::disconnect | ( | ) |
Definition at line 476 of file cromp_client.cpp.
References AUTO_LOCK.
Referenced by ~cromp_client().
void cromp::cromp_client::enable_encryption | ( | ) |
Definition at line 176 of file cromp_client.cpp.
References cromp::cromp_common::add_tentacle(), AUTO_LOCK, FUNCDEF, cromp::cromp_common::localhost_only_key(), LOG, cromp::cromp_common::other_side(), and crypto::rsa_crypto::private_key().
const octopus_entity & cromp::cromp_client::entity | ( | ) | const |
Definition at line 243 of file cromp_client.cpp.
References AUTO_LOCK.
Referenced by instance_name().
|
inline |
Definition at line 65 of file cromp_client.h.
References entity(), and octopi::octopus_entity::text_form().
Referenced by asynch_connect().
void cromp::cromp_client::keep_alive_pause | ( | int | duration = 0 , |
int | interval = 40 |
||
) |
Definition at line 483 of file cromp_client.cpp.
References cromp::cromp_common::grab_anything(), and cromp::cromp_common::push_outgoing().
|
virtual |
Definition at line 290 of file cromp_client.cpp.
References octopi::octopus_request_id::_entity, octopi::octenc_key_record::_key, octopi::unhandled_request::_reason, AUTO_LOCK, CAST_REPLY, CHECK_LOCKOUT, octopi::encryption_tentacle::consume(), cromp::cromp_common::ENCRYPTION_MISMATCH, FUNCDEF, crypto::blowfish_crypto::get_key(), octopi::encryption_tentacle::keys(), octopi::key_repository::lock(), LOG, cromp::cromp_common::NO_SERVER, cromp::cromp_common::NOT_FOUND, cromp::cromp_common::OKAY, octopi::encryption_infoton::prepare_public_key(), octopi::encryption_tentacle::private_key(), crypto::blowfish_crypto::set_key(), synchronous_request(), octopi::octopus_entity::text_form(), octopi::octopus_request_id::text_form(), octopi::key_repository::unlock(), and basis::WHACK().
octopus_request_id cromp::cromp_client::next_id | ( | ) |
Definition at line 261 of file cromp_client.cpp.
References AUTO_LOCK, and structures::roller< contents >::next_id().
Referenced by submit().
void cromp::cromp_client::reset | ( | const sockets::internet_address & | destination, |
int | connection_wait = DEFAULT_MAX_CONNECT_WAIT , |
||
int | max_per_ent = DEFAULT_MAX_ENTITY_QUEUE |
||
) |
Definition at line 220 of file cromp_client.cpp.
References AUTO_LOCK, cromp::cromp_common::close_common(), FUNCDEF, LOG, octopi::octopus_entity::mangled_form(), cromp::cromp_common::max_bytes_per_entity(), cromp::cromp_common::open_common(), and structures::roller< contents >::set_current().
outcome cromp::cromp_client::submit | ( | const octopi::infoton & | request, |
octopi::octopus_request_id & | item_id, | ||
int | max_tries = 80 |
||
) |
Definition at line 542 of file cromp_client.cpp.
References cromp::cromp_common::BAD_INPUT, CHECK_LOCKOUT, FUNCDEF, LOG, next_id(), and cromp::cromp_common::pack_and_ship().
Referenced by synchronous_request().
outcome cromp::cromp_client::synchronous_request | ( | const octopi::infoton & | to_send, |
octopi::infoton *& | received, | ||
octopi::octopus_request_id & | item_id, | ||
int | timeout = DEFAULT_MAX_RESPONSE_WAIT |
||
) |
Definition at line 267 of file cromp_client.cpp.
References acquire(), FUNCDEF, LOG, NULL_POINTER, cromp::cromp_common::OKAY, cromp::cromp_common::outcome_name(), submit(), and octopi::infoton::text_form().
Referenced by login().
const byte_array & cromp::cromp_client::verification | ( | ) | const |
Definition at line 173 of file cromp_client.cpp.
Referenced by connect().
|
friend |
Definition at line 175 of file cromp_client.h.
Referenced by asynch_connect().