feisty meow concerns codebase  2.140
cromp::cromp_client Class Reference

#include <cromp_client.h>

Inheritance diagram for cromp::cromp_client:
Collaboration diagram for cromp::cromp_client:

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
}
 

Public Member Functions

 cromp_client (const sockets::internet_address &destination, int connection_wait=DEFAULT_MAX_CONNECT_WAIT, int max_per_ent=DEFAULT_MAX_ENTITY_QUEUE)
 
virtual ~cromp_client ()
 
 DEFINE_CLASS_NAME ("cromp_client")
 
basis::astring instance_name () const
 
const octopi::octopus_entityentity () const
 
void enable_encryption ()
 
void reset (const sockets::internet_address &destination, int connection_wait=DEFAULT_MAX_CONNECT_WAIT, int max_per_ent=DEFAULT_MAX_ENTITY_QUEUE)
 
basis::outcome connect (const basis::byte_array &verification=blank_verification())
 
basis::outcome asynch_connect ()
 
bool connected () const
 
basis::outcome disconnect ()
 
virtual basis::outcome login ()
 
basis::outcome submit (const octopi::infoton &request, octopi::octopus_request_id &item_id, int max_tries=80)
 
basis::outcome acquire (octopi::infoton *&response, const octopi::octopus_request_id &cmd_id, int timeout=DEFAULT_MAX_RESPONSE_WAIT)
 
basis::outcome synchronous_request (const octopi::infoton &to_send, octopi::infoton *&received, octopi::octopus_request_id &item_id, int timeout=DEFAULT_MAX_RESPONSE_WAIT)
 
basis::outcome acquire_any (octopi::infoton *&response, octopi::octopus_request_id &cmd_id, int timeout=DEFAULT_MAX_RESPONSE_WAIT)
 
octopi::octopus_request_id next_id ()
 
void decrypt_package_as_needed (basis::outcome &to_return, octopi::infoton *&response, const octopi::octopus_request_id &cmd_id)
 
void keep_alive_pause (int duration=0, int interval=40)
 
const basis::byte_arrayverification () const
 
- Public Member Functions inherited from cromp::cromp_common
 cromp_common (const basis::astring &host, int max_per_ent)
 
 cromp_common (sockets::spocket *preexisting, octopi::octopus *singleton)
 
virtual ~cromp_common ()
 
 DEFINE_CLASS_NAME ("cromp_common")
 
basis::outcome open_common (const sockets::internet_address &where)
 
basis::outcome close_common ()
 
sockets::spocketspock () const
 
sockets::internet_address other_side () const
 
virtual basis::outcome add_tentacle (octopi::tentacle *to_add, bool filter=false)
 
basis::astring responses_text_form () const
 
bool buffer_clog (int clog_point=1 *basis::MEGABYTE) const
 
basis::outcome pack_and_ship (const octopi::infoton &request, const octopi::octopus_request_id &item_id, int max_tries)
 
basis::outcome pack_and_ship (const octopi::infoton_list &requests, int max_tries)
 
basis::outcome retrieve_and_restore (octopi::infoton *&item, const octopi::octopus_request_id &req_id, int timeout)
 
basis::outcome retrieve_and_restore_any (octopi::infoton *&item, octopi::octopus_request_id &req_id, int timeout)
 
basis::outcome push_outgoing (int max_tries)
 
void grab_anything (bool wait)
 
basis::outcome send_buffer ()
 
int max_bytes_per_entity () const
 
void max_bytes_per_entity (int max_bytes_per_entity)
 
octopi::octopusocto () const
 
int pending_sends () const
 returns the number of bytes still unsent. More...
 
int accumulated_bytes () const
 returns the number of bytes pending processing from the other side. More...
 

Static Public Member Functions

static const basis::byte_arrayblank_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_cryptolocalhost_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::octopussingleton () const
 

Detailed Description

Definition at line 44 of file cromp_client.h.

Member Enumeration Documentation

◆ constraints

Enumerator
DEFAULT_MAX_CONNECT_WAIT 
DEFAULT_MAX_RESPONSE_WAIT 

Definition at line 47 of file cromp_client.h.

Constructor & Destructor Documentation

◆ cromp_client()

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 
)

◆ ~cromp_client()

cromp::cromp_client::~cromp_client ( )
virtual

Member Function Documentation

◆ acquire()

◆ acquire_any()

◆ asynch_connect()

◆ blank_verification()

const byte_array & cromp::cromp_client::blank_verification ( )
static

Definition at line 287 of file cromp_client.cpp.

◆ connect()

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().

◆ connected()

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().

◆ decrypt_package_as_needed()

◆ DEFINE_CLASS_NAME()

cromp::cromp_client::DEFINE_CLASS_NAME ( "cromp_client"  )

◆ disconnect()

outcome cromp::cromp_client::disconnect ( )

Definition at line 476 of file cromp_client.cpp.

References AUTO_LOCK.

Referenced by ~cromp_client().

◆ enable_encryption()

◆ entity()

const octopus_entity & cromp::cromp_client::entity ( ) const

Definition at line 243 of file cromp_client.cpp.

References AUTO_LOCK.

Referenced by instance_name().

◆ instance_name()

basis::astring cromp::cromp_client::instance_name ( ) const
inline

Definition at line 65 of file cromp_client.h.

References entity(), and octopi::octopus_entity::text_form().

Referenced by asynch_connect().

◆ keep_alive_pause()

void cromp::cromp_client::keep_alive_pause ( int  duration = 0,
int  interval = 40 
)

◆ login()

◆ next_id()

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().

◆ reset()

◆ submit()

outcome cromp::cromp_client::submit ( const octopi::infoton request,
octopi::octopus_request_id item_id,
int  max_tries = 80 
)

◆ 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 
)

◆ verification()

const byte_array & cromp::cromp_client::verification ( ) const

Definition at line 173 of file cromp_client.cpp.

Referenced by connect().

Friends And Related Function Documentation

◆ asynch_connection_thread

friend class asynch_connection_thread
friend

Definition at line 175 of file cromp_client.h.

Referenced by asynch_connect().


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