1 #ifndef CROMP_COMMON_CLASS
2 #define CROMP_COMMON_CLASS
80 OKAY = basis::common::OKAY,
90 NO_SERVER = sockets::communication_commons::NO_SERVER,
93 DEFINE_OUTCOME(TOO_FULL, -40,
"The request cannot be processed yet")
214 static double _bytes_sent_total;
215 static double _bytes_received_total;
217 void snarf_from_socket(
bool wait);
221 void process_accumulator();
224 void conditional_cleaning();
Provides a dynamically resizable ASCII character string.
A very common template for a dynamic array of bytes.
Outcomes describe the state of completion for an operation.
A few common features used by both CROMP clients and servers.
DEFINE_CLASS_NAME("cromp_common")
static double total_bytes_sent()
static const char * outcome_name(const basis::outcome &to_name)
octopi::octopus * octo() const
static const int HOSTCHOP
bool buffer_clog(int clog_point=1 *basis::MEGABYTE) const
basis::outcome open_common(const sockets::internet_address &where)
basis::outcome push_outgoing(int max_tries)
sockets::spocket * spock() const
cromp_common(const basis::astring &host, int max_per_ent)
basis::outcome retrieve_and_restore(octopi::infoton *&item, const octopi::octopus_request_id &req_id, int timeout)
basis::outcome close_common()
static double total_bytes_received()
int accumulated_bytes() const
returns the number of bytes pending processing from the other side.
basis::outcome pack_and_ship(const octopi::infoton &request, const octopi::octopus_request_id &item_id, int max_tries)
sockets::internet_address other_side() const
static int default_port()
basis::outcome retrieve_and_restore_any(octopi::infoton *&item, octopi::octopus_request_id &req_id, int timeout)
static basis::astring chew_hostname(const sockets::internet_address &addr, sockets::internet_address *resolved=NULL_POINTER)
octopi::octopus * singleton() const
int max_bytes_per_entity() const
basis::astring responses_text_form() const
static bool decode_host(const basis::astring &coded_host, basis::astring &hostname, sockets::machine_uid &machine)
int pending_sends() const
returns the number of bytes still unsent.
virtual basis::outcome add_tentacle(octopi::tentacle *to_add, bool filter=false)
basis::outcome send_buffer()
void grab_anything(bool wait)
static const crypto::rsa_crypto & localhost_only_key()
Supports public key encryption and decryption.
Stores a set of infotons grouped by the entity that owns them.
a list of pending requests and who made them.
An infoton is an individual request parcel with accompanying information.
Identifies requests made on an octopus by users.
Octopus is a design pattern for generalized request processing systems.
Manages a service within an octopus by processing certain infotons.
this type of address describes a destination out on the internet.
Abstraction for a higher-level BSD socket that is platform independent.
Represents a point in time relative to the operating system startup time.
#define NULL_POINTER
The value representing a pointer to nothing.
const int MEGABYTE
Number of bytes in a megabyte.
const int DEFAULT_MAX_ENTITY_QUEUE
the default size we allow per each entity.
#define DEFINE_OUTCOME(NAME, CURRENT_VALUE, INFO_STRING)
Provides a way to define auto-generated outcome values.