dtn::TCPConvergenceLayer::Connection Class Reference

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

#include <TCPConvergenceLayer.h>

Inheritance diagram for dtn::TCPConvergenceLayer::Connection:
dtn::StreamConvergenceLayer::Connection dtn::CLConnection dtn::CLInfo

List of all members.

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 ()
 Hook for handle_poll_activity to receive data.
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::TCPClient * sock_
 The socket.
struct pollfd * sock_pollfd_
 Poll structure for the socket.

Friends

class TCPConvergenceLayer

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 118 of file TCPConvergenceLayer.h.


Constructor & Destructor Documentation

dtn::TCPConvergenceLayer::Connection::Connection ( TCPConvergenceLayer cl,
TCPLinkParams params 
)
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.

Definition at line 311 of file TCPConvergenceLayer.cc.

References dtn::CLConnection::set_nexthop(), and sock_.

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

Destructor.

Definition at line 332 of file TCPConvergenceLayer.cc.

References sock_.


Member Function Documentation

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

Virtual from CLConnection.

Reimplemented from dtn::CLConnection.

Definition at line 432 of file TCPConvergenceLayer.cc.

References ASSERT, dtn::StreamConvergenceLayer::Connection::initiate_contact(), and sock_.

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

Virtual from CLConnection.

Implements dtn::CLConnection.

Definition at line 443 of file TCPConvergenceLayer.cc.

References sock_.

void dtn::TCPConvergenceLayer::Connection::handle_poll_activity (  )  [protected, virtual]
void dtn::TCPConvergenceLayer::Connection::initialize_pollfds (  )  [protected, virtual]
void dtn::TCPConvergenceLayer::Connection::recv_data (  )  [protected]
void dtn::TCPConvergenceLayer::Connection::send_data (  )  [protected, virtual]
void dtn::TCPConvergenceLayer::Connection::serialize ( oasys::SerializeAction *  a  )  [virtual]
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 163 of file TCPConvergenceLayer.h.

References ASSERT, and dtn::CLConnection::params_.

Referenced by recv_data(), send_data(), and serialize().


Friends And Related Function Documentation

friend class TCPConvergenceLayer [friend]

Definition at line 142 of file TCPConvergenceLayer.h.


Member Data Documentation

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

Poll structure for the socket.

Definition at line 171 of file TCPConvergenceLayer.h.

Referenced by connect(), handle_poll_activity(), initialize_pollfds(), and send_data().


The documentation for this class was generated from the following files:
Generated on Sun Nov 21 13:21:19 2010 for DTN Reference Implementation by  doxygen 1.6.3