dtn::TCPConvergenceLayer::Connection Class Reference

#include <TCPConvergenceLayer.h>

List of all members.


Detailed Description

Helper class (and thread) that manages an established connection with a peer daemon.

Although the same class is used in both cases, a particular Connection is either a receiver or a sender, as indicated by the direction variable. Note that to deal with NAT, the side which does the active connect is not necessarily the sender.

Definition at line 116 of file TCPConvergenceLayer.h.


Public Member Functions

 Connection (TCPConvergenceLayer *cl, TCPLinkParams *params)
 Constructor for the active connect side of a connection.
 Connection (TCPConvergenceLayer *cl, TCPLinkParams *params, int fd, in_addr_t addr, u_int16_t port)
 Constructor for the passive accept side of a connection.
virtual ~Connection ()
 Destructor.
virtual void serialize (oasys::SerializeAction *a)
 Virtual from SerializableObject.

Protected Member Functions

void recv_data ()
bool recv_contact_header (int timeout)
bool send_bundle (Bundle *bundle)
bool recv_bundle ()
bool handle_reply ()
int handle_ack ()
bool send_ack (u_int32_t bundle_id, size_t acked_len)
bool send_keepalive ()
TCPLinkParamstcp_lparams ()
 Utility function to downcast the params_ pointer that's stored in the CLConnection parent class.
virtual void connect ()
 Virtual from CLConnection.
virtual void accept ()
 Virtual from CLConnection.
virtual void disconnect ()
 Virtual from CLConnection.
virtual void initialize_pollfds ()
 Virtual from CLConnection.
virtual void handle_poll_activity ()
 Virtual from CLConnection.
void send_data ()
 virtual from StreamConvergenceLayer::Connection

Protected Attributes

oasys::TCPClientsock_
 The socket.
struct pollfd * sock_pollfd_
 Poll structure for the socket.

Friends

class TCPConvergenceLayer

Constructor & Destructor Documentation

dtn::TCPConvergenceLayer::Connection::Connection ( TCPConvergenceLayer cl,
TCPLinkParams params 
)

Constructor for the active connect side of a connection.

dtn::TCPConvergenceLayer::Connection::Connection ( TCPConvergenceLayer cl,
TCPLinkParams params,
int  fd,
in_addr_t  addr,
u_int16_t  port 
)

Constructor for the passive accept side of a connection.

virtual dtn::TCPConvergenceLayer::Connection::~Connection (  )  [virtual]

Destructor.


Member Function Documentation

virtual void dtn::TCPConvergenceLayer::Connection::serialize ( oasys::SerializeAction a  )  [virtual]

Virtual from SerializableObject.

virtual void dtn::TCPConvergenceLayer::Connection::connect (  )  [protected, virtual]

Virtual from CLConnection.

virtual void dtn::TCPConvergenceLayer::Connection::accept (  )  [protected, virtual]

Virtual from CLConnection.

virtual void dtn::TCPConvergenceLayer::Connection::disconnect (  )  [protected, virtual]

Virtual from CLConnection.

virtual void dtn::TCPConvergenceLayer::Connection::initialize_pollfds (  )  [protected, virtual]

Virtual from CLConnection.

virtual void dtn::TCPConvergenceLayer::Connection::handle_poll_activity (  )  [protected, virtual]

Virtual from CLConnection.

void dtn::TCPConvergenceLayer::Connection::send_data (  )  [protected]

virtual from StreamConvergenceLayer::Connection

void dtn::TCPConvergenceLayer::Connection::recv_data (  )  [protected]

bool dtn::TCPConvergenceLayer::Connection::recv_contact_header ( int  timeout  )  [protected]

bool dtn::TCPConvergenceLayer::Connection::send_bundle ( Bundle bundle  )  [protected]

bool dtn::TCPConvergenceLayer::Connection::recv_bundle (  )  [protected]

bool dtn::TCPConvergenceLayer::Connection::handle_reply (  )  [protected]

int dtn::TCPConvergenceLayer::Connection::handle_ack (  )  [protected]

bool dtn::TCPConvergenceLayer::Connection::send_ack ( u_int32_t  bundle_id,
size_t  acked_len 
) [protected]

bool dtn::TCPConvergenceLayer::Connection::send_keepalive (  )  [protected]

TCPLinkParams* dtn::TCPConvergenceLayer::Connection::tcp_lparams (  )  [inline, protected]

Utility function to downcast the params_ pointer that's stored in the CLConnection parent class.

Definition at line 167 of file TCPConvergenceLayer.h.

References ASSERT, dtn::CLConnection::params_, and tcp_lparams().

Referenced by tcp_lparams().


Friends And Related Function Documentation

friend class TCPConvergenceLayer [friend]

Definition at line 140 of file TCPConvergenceLayer.h.


Member Data Documentation

oasys::TCPClient* dtn::TCPConvergenceLayer::Connection::sock_ [protected]

The socket.

Definition at line 174 of file TCPConvergenceLayer.h.

struct pollfd* dtn::TCPConvergenceLayer::Connection::sock_pollfd_ [read, protected]

Poll structure for the socket.

Definition at line 175 of file TCPConvergenceLayer.h.


The documentation for this class was generated from the following file:
Generated on Sat Sep 8 08:43:46 2007 for DTN Reference Implementation by  doxygen 1.5.3