xorp

XrlPFSTCPSender Class Reference

Sender of Xrls by TCP. More...

#include <xrl_pf_stcp.hh>

Inheritance diagram for XrlPFSTCPSender:
XrlPFSender NONCOPYABLE XrlPFUNIXSender

List of all members.

Public Member Functions

 XrlPFSTCPSender (const string &name, EventLoop &e, const char *address=0, TimeVal keepalive_period=DEFAULT_SENDER_KEEPALIVE_PERIOD) throw (XrlPFConstructorError)
 XrlPFSTCPSender (const string &name, EventLoop *e, const char *address=0, TimeVal keepalive_period=DEFAULT_SENDER_KEEPALIVE_PERIOD)
bool send (const Xrl &x, bool direct_call, const XrlPFSender::SendCallback &cb)
 Send an Xrl.
bool sends_pending () const
bool alive () const
 Determine if the underlying transport is still open.
virtual const char * protocol () const
void set_keepalive_time (const TimeVal &time)
const TimeValkeepalive_time () const
virtual string toString () const

Static Public Member Functions

static const char * protocol_name ()

Static Public Attributes

static const TimeVal DEFAULT_SENDER_KEEPALIVE_PERIOD = TimeVal(10, 0)

Protected Member Functions

void construct ()

Protected Attributes

XorpFd _sock

Private Types

typedef map< uint32_t, ref_ptr
< RequestState > > 
RequestMap

Private Member Functions

void die (const char *reason, bool verbose=true)
void update_writer (AsyncFileWriter::Event e, const uint8_t *buffer, size_t buffer_bytes, size_t bytes_done)
RequestStatefind_request (uint32_t seqno)
void read_event (BufferedAsyncReader *reader, BufferedAsyncReader::Event ev, uint8_t *buffer, size_t buffer_bytes)
void send_request (RequestState *)
void dispose_request (RequestMap::iterator ptr)
void start_keepalives ()
void stop_keepalives ()
void defer_keepalives ()
bool send_keepalive ()

Private Attributes

uint32_t _uid
AsyncFileWriter_writer
list< ref_ptr< RequestState > > _requests_waiting
RequestMap _requests_sent
uint32_t _current_seqno
size_t _active_bytes
size_t _active_requests
TimeVal _keepalive_time
BufferedAsyncReader_reader
vector< uint8_t > _reply
XorpTimer _keepalive_timer
TimeVal _keepalive_last_fired
bool _keepalive_sent

Static Private Attributes

static const char * _protocol = "stcp"
static uint32_t _next_uid = 0

Detailed Description

Sender of Xrls by TCP.


Member Function Documentation

bool XrlPFSTCPSender::alive ( ) const [inline, virtual]

Determine if the underlying transport is still open.

Returns:
true if the transport is alive.

Implements XrlPFSender.

bool XrlPFSTCPSender::send ( const Xrl xrl,
bool  direct_call,
const XrlPFSender::SendCallback &  cb 
) [virtual]

Send an Xrl.

This method attempts to perform the sender side processing of an XRL.

If a direct_call the method will return true or false to indicate success to the caller. If not a direct call, a failure will be communicated via a callback since there's no way to get the information directly back to the caller.

Parameters:
xrlXRL to be sent.
direct_callindication of whether the caller is on the stack.
cbCallback to be invoked with result.

Implements XrlPFSender.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations