feisty meow concerns codebase  2.140
cromp::cromp_common Class Reference

A few common features used by both CROMP clients and servers. More...

#include <cromp_common.h>

Inheritance diagram for cromp::cromp_common:
Collaboration diagram for cromp::cromp_common:

Public Types

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

Static Public Attributes

static const int HOSTCHOP = 6
 

Protected Member Functions

octopi::octopussingleton () const
 

Detailed Description

A few common features used by both CROMP clients and servers.

Definition at line 35 of file cromp_common.h.

Member Enumeration Documentation

◆ outcomes

Enumerator
OKAY 
DISALLOWED 
BAD_INPUT 
NOT_FOUND 
TIMED_OUT 
GARBAGE 
NO_HANDLER 
PARTIAL 
ENCRYPTION_MISMATCH 
NO_SERVER 
NO_CONNECTION 

Definition at line 79 of file cromp_common.h.

Constructor & Destructor Documentation

◆ cromp_common() [1/2]

cromp::cromp_common::cromp_common ( const basis::astring host,
int  max_per_ent 
)

Definition at line 130 of file cromp_common.cpp.

References FUNCDEF, and basis::array< contents >::reset().

◆ cromp_common() [2/2]

cromp::cromp_common::cromp_common ( sockets::spocket preexisting,
octopi::octopus singleton 
)

◆ ~cromp_common()

cromp::cromp_common::~cromp_common ( )
virtual

Definition at line 180 of file cromp_common.cpp.

References close_common(), FUNCDEF, NULL_POINTER, and basis::WHACK().

Member Function Documentation

◆ accumulated_bytes()

int cromp::cromp_common::accumulated_bytes ( ) const

returns the number of bytes pending processing from the other side.

Definition at line 215 of file cromp_common.cpp.

References basis::array< contents >::length().

◆ add_tentacle()

outcome cromp::cromp_common::add_tentacle ( octopi::tentacle to_add,
bool  filter = false 
)
virtual

◆ buffer_clog()

bool cromp::cromp_common::buffer_clog ( int  clog_point = 1 * basis::MEGABYTE) const

Definition at line 347 of file cromp_common.cpp.

References basis::array< contents >::length().

◆ chew_hostname()

◆ close_common()

◆ decode_host()

bool cromp::cromp_common::decode_host ( const basis::astring coded_host,
basis::astring hostname,
sockets::machine_uid machine 
)
static

◆ default_port()

int cromp::cromp_common::default_port ( )
static

Definition at line 204 of file cromp_common.cpp.

◆ DEFINE_CLASS_NAME()

cromp::cromp_common::DEFINE_CLASS_NAME ( "cromp_common"  )

◆ grab_anything()

void cromp::cromp_common::grab_anything ( bool  wait)

Definition at line 610 of file cromp_common.cpp.

Referenced by cromp::cromp_client::keep_alive_pause(), and push_outgoing().

◆ localhost_only_key()

static const crypto::rsa_crypto& cromp::cromp_common::localhost_only_key ( )
static

◆ max_bytes_per_entity() [1/2]

int cromp::cromp_common::max_bytes_per_entity ( ) const

◆ max_bytes_per_entity() [2/2]

void cromp::cromp_common::max_bytes_per_entity ( int  max_bytes_per_entity)

◆ octo()

◆ open_common()

◆ other_side()

internet_address cromp::cromp_common::other_side ( ) const

Definition at line 263 of file cromp_common.cpp.

References sockets::spocket::where().

Referenced by cromp::cromp_client::enable_encryption(), and open_common().

◆ outcome_name()

const char * cromp::cromp_common::outcome_name ( const basis::outcome to_name)
static

◆ pack_and_ship() [1/2]

outcome cromp::cromp_common::pack_and_ship ( const octopi::infoton request,
const octopi::octopus_request_id item_id,
int  max_tries 
)

◆ pack_and_ship() [2/2]

outcome cromp::cromp_common::pack_and_ship ( const octopi::infoton_list requests,
int  max_tries 
)

◆ pending_sends()

int cromp::cromp_common::pending_sends ( ) const

returns the number of bytes still unsent.

Definition at line 209 of file cromp_common.cpp.

References basis::array< contents >::length().

◆ push_outgoing()

◆ responses_text_form()

astring cromp::cromp_common::responses_text_form ( ) const

Definition at line 260 of file cromp_common.cpp.

References octopi::entity_data_bin::text_form().

◆ retrieve_and_restore()

outcome cromp::cromp_common::retrieve_and_restore ( octopi::infoton *&  item,
const octopi::octopus_request_id req_id,
int  timeout 
)

Definition at line 545 of file cromp_common.cpp.

Referenced by cromp::cromp_client::acquire().

◆ retrieve_and_restore_any()

outcome cromp::cromp_common::retrieve_and_restore_any ( octopi::infoton *&  item,
octopi::octopus_request_id req_id,
int  timeout 
)

Definition at line 552 of file cromp_common.cpp.

Referenced by cromp::cromp_client::acquire_any().

◆ send_buffer()

◆ singleton()

octopi::octopus* cromp::cromp_common::singleton ( ) const
inlineprotected

Definition at line 196 of file cromp_common.h.

◆ spock()

spocket * cromp::cromp_common::spock ( ) const

Definition at line 202 of file cromp_common.cpp.

Referenced by cromp::cromp_client::connected().

◆ total_bytes_received()

static double cromp::cromp_common::total_bytes_received ( )
inlinestatic

Definition at line 163 of file cromp_common.h.

◆ total_bytes_sent()

static double cromp::cromp_common::total_bytes_sent ( )
inlinestatic

Definition at line 162 of file cromp_common.h.

Member Data Documentation

◆ HOSTCHOP

const int cromp::cromp_common::HOSTCHOP = 6
static

Definition at line 165 of file cromp_common.h.

Referenced by chew_hostname(), and decode_host().


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