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:
Inheritance graph
[legend]
Collaboration diagram for cromp::cromp_common:
Collaboration graph
[legend]

List of all members.

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.
int accumulated_bytes () const
 returns the number of bytes pending processing from the other side.

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=NIL)
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

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::cromp_common::cromp_common ( const basis::astring host,
int  max_per_ent 
)

Definition at line 130 of file cromp_common.cpp.

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

cromp::cromp_common::cromp_common ( sockets::spocket preexisting,
octopi::octopus singleton 
)
cromp::cromp_common::~cromp_common (  )  [virtual]

Definition at line 180 of file cromp_common.cpp.

References close_common(), NIL, and basis::WHACK().


Member Function Documentation

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

outcome cromp::cromp_common::add_tentacle ( octopi::tentacle to_add,
bool  filter = false 
) [virtual]
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().

astring cromp::cromp_common::chew_hostname ( const sockets::internet_address addr,
sockets::internet_address resolved = NIL 
) [static]
outcome cromp::cromp_common::close_common (  ) 
bool cromp::cromp_common::decode_host ( const basis::astring coded_host,
basis::astring hostname,
sockets::machine_uid machine 
) [static]
int cromp::cromp_common::default_port (  )  [static]

Definition at line 204 of file cromp_common.cpp.

cromp::cromp_common::DEFINE_CLASS_NAME ( "cromp_common"   ) 
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().

static const crypto::rsa_crypto& cromp::cromp_common::localhost_only_key (  )  [static]
void cromp::cromp_common::max_bytes_per_entity ( int  max_bytes_per_entity  ) 
int cromp::cromp_common::max_bytes_per_entity (  )  const
octopi::octopus* cromp::cromp_common::octo (  )  const [inline]
outcome cromp::cromp_common::open_common ( const sockets::internet_address where  ) 
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().

const char * cromp::cromp_common::outcome_name ( const basis::outcome to_name  )  [static]
outcome cromp::cromp_common::pack_and_ship ( const octopi::infoton_list requests,
int  max_tries 
)
outcome cromp::cromp_common::pack_and_ship ( const octopi::infoton request,
const octopi::octopus_request_id item_id,
int  max_tries 
)
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().

outcome cromp::cromp_common::push_outgoing ( int  max_tries  ) 
astring cromp::cromp_common::responses_text_form (  )  const

Reimplemented in cromp::cromp_server.

Definition at line 260 of file cromp_common.cpp.

References octopi::entity_data_bin::text_form().

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

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

outcome cromp::cromp_common::send_buffer (  ) 
octopi::octopus* cromp::cromp_common::singleton (  )  const [inline, protected]

Definition at line 196 of file cromp_common.h.

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

Definition at line 202 of file cromp_common.cpp.

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

static double cromp::cromp_common::total_bytes_received (  )  [inline, static]

Definition at line 163 of file cromp_common.h.

static double cromp::cromp_common::total_bytes_sent (  )  [inline, static]

Definition at line 162 of file cromp_common.h.


Member Data Documentation

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:
Generated on Sat Jan 28 04:25:30 2012 for hoople2 project by  doxygen 1.6.3