Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

SRPC_impl Class Reference

#include <SRPC_impl.H>

List of all members.

Public Types

enum  item_code {
  ic_null = 0, ic_hello = 10, ic_start_call = 11, ic_end_call = 12,
  ic_end_ack = 13, ic_seq_start = 20, ic_seq_end = 21, ic_int16 = 28,
  ic_int16_array = 29, ic_int32 = 30, ic_int32_seq = 31, ic_chars = 32,
  ic_chars_seq = 33, ic_bytes = 34, ic_bytes_seq = 35, ic_text = 36,
  ic_socket = 40, ic_int64 = 41, ic_int32_array = 42, ic_int64_array = 43,
  ic_bool_true = 44, ic_bool_false = 45, ic_failure = 255
}
enum  rpc_state {
  initial = 0, ready = 1, data_out = 2, seq_out = 3,
  data_in = 4, seq_in = 5, failed = 6
}
enum  ops {
  op_start_call = 0, op_await_call = 1, op_send_int32 = 2, op_recv_int32 = 3,
  op_send_chars = 4, op_recv_chars = 5, op_recv_chars_here = 6, op_send_bytes = 7,
  op_recv_bytes = 8, op_recv_bytes_here = 9, op_send_text = 10, op_recv_text = 11,
  op_send_socket = 12, op_recv_socket = 13, op_send_int32_seq = 14, op_recv_int32_seq = 15,
  op_send_chars_seq = 16, op_recv_chars_seq = 17, op_send_bytes_seq = 18, op_recv_bytes_seq = 19,
  op_send_seq_start = 20, op_recv_seq_start = 21, op_send_seq_end = 22, op_recv_seq_end = 23,
  op_send_end = 24, op_recv_end = 25, op_send_failure = 26, op_send_int16 = 27,
  op_recv_int16 = 28, op_send_int16_array = 29, op_recv_int16_array = 30, op_send_int64 = 31,
  op_recv_int64 = 32, op_send_int32_array = 33, op_recv_int32_array = 34, op_send_int64_array = 35,
  op_recv_int64_array = 36, op_send_bool = 37, op_recv_bool = 38
}

Public Member Functions

 SRPC_impl (bool i_am_caller)
 ~SRPC_impl () throw (SRPC::failure)
void send_item_code (item_code ic, bool flush=false) throw (TCP_sock::failure)
item_code read_item_code () throw (TCP_sock::failure, SRPC::failure)
void recv_item_code (item_code expected, bool *got_end=NULL) throw (TCP_sock::failure, SRPC::failure)
item_code recv_item_code (item_code expected1, item_code expected2, bool *got_end) throw (TCP_sock::failure, SRPC::failure)
void send_int16 (Basics::int16 i, bool flush=false) throw (TCP_sock::failure)
Basics::int16 recv_int16 () throw (TCP_sock::failure)
void send_int32 (Basics::int32 i, bool flush=false) throw (TCP_sock::failure)
Basics::int32 recv_int32 () throw (TCP_sock::failure)
void send_int64 (Basics::int64 i, bool flush=false) throw (TCP_sock::failure)
Basics::int64 recv_int64 () throw (TCP_sock::failure)
void send_bytes (const char *bs, int len, bool flush=false) throw (TCP_sock::failure)
void recv_bytes (char *bs, int len) throw (TCP_sock::failure, SRPC::failure)
void check_state (int op) throw (SRPC::failure)
void ensure_sending_state () throw ()
void ensure_recving_state () throw ()
void throw_failure (int reason, const Text &msg, bool local_only=false) throw (SRPC::failure)
void report_TCP_failure (TCP_sock::failure &tf) throw (SRPC::failure)

Public Attributes

rpc_state state
SRPC::failure f
bool is_caller
bool is_sender
bool version_sent
bool version_checked
item_code buffered_ic
TCP_socks
SRPC_listenerlistener
bool use_read_timeout
bool use_read_timeout_between_calls
unsigned int read_timeout_secs

Friends

class SRPC


Member Enumeration Documentation

enum SRPC_impl::item_code
 

Enumeration values:
ic_null 
ic_hello 
ic_start_call 
ic_end_call 
ic_end_ack 
ic_seq_start 
ic_seq_end 
ic_int16 
ic_int16_array 
ic_int32 
ic_int32_seq 
ic_chars 
ic_chars_seq 
ic_bytes 
ic_bytes_seq 
ic_text 
ic_socket 
ic_int64 
ic_int32_array 
ic_int64_array 
ic_bool_true 
ic_bool_false 
ic_failure 

Definition at line 60 of file SRPC_impl.H.

enum SRPC_impl::ops
 

Enumeration values:
op_start_call 
op_await_call 
op_send_int32 
op_recv_int32 
op_send_chars 
op_recv_chars 
op_recv_chars_here 
op_send_bytes 
op_recv_bytes 
op_recv_bytes_here 
op_send_text 
op_recv_text 
op_send_socket 
op_recv_socket 
op_send_int32_seq 
op_recv_int32_seq 
op_send_chars_seq 
op_recv_chars_seq 
op_send_bytes_seq 
op_recv_bytes_seq 
op_send_seq_start 
op_recv_seq_start 
op_send_seq_end 
op_recv_seq_end 
op_send_end 
op_recv_end 
op_send_failure 
op_send_int16 
op_recv_int16 
op_send_int16_array 
op_recv_int16_array 
op_send_int64 
op_recv_int64 
op_send_int32_array 
op_recv_int32_array 
op_send_int64_array 
op_recv_int64_array 
op_send_bool 
op_recv_bool 

Definition at line 102 of file SRPC_impl.H.

enum SRPC_impl::rpc_state
 

Enumeration values:
initial 
ready 
data_out 
seq_out 
data_in 
seq_in 
failed 

Definition at line 92 of file SRPC_impl.H.


Constructor & Destructor Documentation

SRPC_impl::SRPC_impl bool  i_am_caller  ) 
 

Definition at line 59 of file SRPC_impl.C.

SRPC_impl::~SRPC_impl  )  throw (SRPC::failure)
 

Definition at line 70 of file SRPC_impl.C.

References SRPC_listener::destroy(), SRPC::internal_trouble, s, and throw_failure().


Member Function Documentation

void SRPC_impl::check_state int  op  )  throw (SRPC::failure)
 

Definition at line 214 of file SRPC_impl.C.

References cc_pos, SRPC::protocol_violation, rs_pos, and state0_pos.

void SRPC_impl::ensure_recving_state  )  throw ()
 

Definition at line 237 of file SRPC_impl.C.

References data_in, seq_in, and state.

void SRPC_impl::ensure_sending_state  )  throw ()
 

Definition at line 226 of file SRPC_impl.C.

References data_out, seq_out, and state.

item_code SRPC_impl::read_item_code  )  throw (TCP_sock::failure, SRPC::failure)
 

Definition at line 353 of file SRPC_impl.C.

References buffered_ic, ic_failure, ic_hello, ic_null, listener, NEW_PTRFREE_ARRAY, SRPC::protocol_violation, recv_bytes(), recv_int32(), s, SRPC_listener::sock, SRPC_VERSION, throw_failure(), version_checked, and TCP_sock::wait_for_connect().

void SRPC_impl::recv_bytes char *  bs,
int  len
throw (TCP_sock::failure, SRPC::failure)
 

Definition at line 259 of file SRPC_impl.C.

References initial.

Referenced by read_item_code(), recv_int16(), recv_int32(), and recv_int64().

Basics::int16 SRPC_impl::recv_int16  )  throw (TCP_sock::failure)
 

Definition at line 297 of file SRPC_impl.C.

References Basics::ntoh16(), and recv_bytes().

Basics::int32 SRPC_impl::recv_int32  )  throw (TCP_sock::failure)
 

Definition at line 312 of file SRPC_impl.C.

References Basics::ntoh32(), and recv_bytes().

Referenced by read_item_code().

Basics::int64 SRPC_impl::recv_int64  )  throw (TCP_sock::failure)
 

Definition at line 327 of file SRPC_impl.C.

References Basics::ntoh64(), and recv_bytes().

item_code SRPC_impl::recv_item_code item_code  expected1,
item_code  expected2,
bool *  got_end
throw (TCP_sock::failure, SRPC::failure)
 

Definition at line 436 of file SRPC_impl.C.

References ic_null, ic_seq_end, SRPC::protocol_violation, and seq_in.

void SRPC_impl::recv_item_code item_code  expected,
bool *  got_end = NULL
throw (TCP_sock::failure, SRPC::failure)
 

Definition at line 416 of file SRPC_impl.C.

References ic_seq_end, SRPC::protocol_violation, and seq_in.

void SRPC_impl::report_TCP_failure TCP_sock::failure tf  )  throw (SRPC::failure)
 

Definition at line 101 of file SRPC_impl.C.

References SRPC::convert_TCP_failure(), SRPC::failure::msg, and SRPC::failure::r.

void SRPC_impl::send_bytes const char *  bs,
int  len,
bool  flush = false
throw (TCP_sock::failure)
 

Definition at line 252 of file SRPC_impl.C.

References FdCache::flush().

void SRPC_impl::send_int16 Basics::int16  i,
bool  flush = false
throw (TCP_sock::failure)
 

Definition at line 290 of file SRPC_impl.C.

References FdCache::flush(), and Basics::hton16().

void SRPC_impl::send_int32 Basics::int32  i,
bool  flush = false
throw (TCP_sock::failure)
 

Definition at line 305 of file SRPC_impl.C.

References FdCache::flush(), and Basics::hton32().

void SRPC_impl::send_int64 Basics::int64  i,
bool  flush = false
throw (TCP_sock::failure)
 

Definition at line 320 of file SRPC_impl.C.

References FdCache::flush(), and Basics::hton64().

void SRPC_impl::send_item_code item_code  ic,
bool  flush = false
throw (TCP_sock::failure)
 

Definition at line 339 of file SRPC_impl.C.

References FdCache::flush(), ic_hello, and SRPC_VERSION.

void SRPC_impl::throw_failure int  reason,
const Text msg,
bool  local_only = false
throw (SRPC::failure)
 

Definition at line 83 of file SRPC_impl.C.

References Text::chars(), failed, ic_failure, and Text::Length().

Referenced by read_item_code(), and ~SRPC_impl().


Friends And Related Function Documentation

friend class SRPC [friend]
 

Definition at line 34 of file SRPC_impl.H.


Member Data Documentation

item_code SRPC_impl::buffered_ic
 

Definition at line 234 of file SRPC_impl.H.

Referenced by read_item_code().

SRPC::failure SRPC_impl::f
 

Definition at line 227 of file SRPC_impl.H.

bool SRPC_impl::is_caller
 

Definition at line 229 of file SRPC_impl.H.

bool SRPC_impl::is_sender
 

Definition at line 230 of file SRPC_impl.H.

SRPC_listener* SRPC_impl::listener
 

Definition at line 237 of file SRPC_impl.H.

Referenced by read_item_code().

unsigned int SRPC_impl::read_timeout_secs
 

Definition at line 241 of file SRPC_impl.H.

TCP_sock* SRPC_impl::s
 

Definition at line 236 of file SRPC_impl.H.

Referenced by read_item_code(), SRPC::socket(), and ~SRPC_impl().

rpc_state SRPC_impl::state
 

Definition at line 226 of file SRPC_impl.H.

Referenced by ensure_recving_state(), and ensure_sending_state().

bool SRPC_impl::use_read_timeout
 

Definition at line 239 of file SRPC_impl.H.

Referenced by SRPC::disable_read_timeout().

bool SRPC_impl::use_read_timeout_between_calls
 

Definition at line 240 of file SRPC_impl.H.

bool SRPC_impl::version_checked
 

Definition at line 232 of file SRPC_impl.H.

Referenced by read_item_code().

bool SRPC_impl::version_sent
 

Definition at line 231 of file SRPC_impl.H.


The documentation for this class was generated from the following files:
Generated on Mon May 8 00:49:14 2006 for Vesta by  doxygen 1.4.2