dtn::net::TCPConvergenceLayer::TCPConnection Class Reference

#include <TCPConvergenceLayer.h>

Inheritance diagram for dtn::net::TCPConvergenceLayer::TCPConnection:
dtn::net::GenericConnection dtn::streams::StreamConnection::Callback

List of all members.

Classes

class  Receiver
class  Sender

Public Member Functions

 TCPConnection (ibrcommon::tcpstream *stream)
virtual ~TCPConnection ()
void iamfree ()
void initialize (const dtn::data::EID &name, const size_t timeout=10)
void shutdown ()
const StreamContactHeader getHeader () const
const dtn::core::NodegetNode () const
virtual void eventShutdown ()
virtual void eventTimeout ()
virtual void eventError ()
virtual void eventConnectionUp (const StreamContactHeader &header)
virtual void eventConnectionDown ()
virtual void eventBundleRefused ()
virtual void eventBundleForwarded ()
virtual void eventBundleAck (size_t ack)
bool free ()
dtn::core::Node::Protocol getDiscoveryProtocol () const
void queue (const dtn::data::Bundle &bundle)

Protected Member Functions

void handshake ()
void rejectTransmission ()

Friends

TCPConvergenceLayer::TCPConnectionoperator>> (TCPConvergenceLayer::TCPConnection &conn, dtn::data::Bundle &bundle)
TCPConvergenceLayer::TCPConnectionoperator<< (TCPConvergenceLayer::TCPConnection &conn, const dtn::data::Bundle &bundle)

Detailed Description

Definition at line 47 of file TCPConvergenceLayer.h.


Constructor & Destructor Documentation

dtn::net::TCPConvergenceLayer::TCPConnection::TCPConnection ( ibrcommon::tcpstream stream  ) 
dtn::net::TCPConvergenceLayer::TCPConnection::~TCPConnection (  )  [virtual]

Definition at line 40 of file TCPConnection.cpp.

References shutdown().


Member Function Documentation

void dtn::net::TCPConvergenceLayer::TCPConnection::eventBundleAck ( size_t  ack  )  [virtual]

This method is called if a ACK is received.

Implements dtn::streams::StreamConnection::Callback.

Definition at line 166 of file TCPConnection.cpp.

void dtn::net::TCPConvergenceLayer::TCPConnection::eventBundleForwarded (  )  [virtual]
void dtn::net::TCPConvergenceLayer::TCPConnection::eventBundleRefused (  )  [virtual]

This method is called if a bundle is refused by the peer.

Implements dtn::streams::StreamConnection::Callback.

Definition at line 132 of file TCPConnection.cpp.

References ibrcommon::ThreadSafeQueue< T >::frontpop(), dtn::core::Node::getURI(), and dtn::net::TransferAbortedEvent::raise().

void dtn::net::TCPConvergenceLayer::TCPConnection::eventConnectionDown (  )  [virtual]
void dtn::net::TCPConvergenceLayer::TCPConnection::eventConnectionUp ( const StreamContactHeader header  )  [virtual]
void dtn::net::TCPConvergenceLayer::TCPConnection::eventError (  )  [virtual]

This method is called if a error occured in the stream.

Implements dtn::streams::StreamConnection::Callback.

Definition at line 205 of file TCPConnection.cpp.

void dtn::net::TCPConvergenceLayer::TCPConnection::eventShutdown (  )  [virtual]

callback methods for tcpstream

Implements dtn::streams::StreamConnection::Callback.

Definition at line 171 of file TCPConnection.cpp.

void dtn::net::TCPConvergenceLayer::TCPConnection::eventTimeout (  )  [virtual]

This method is called if the stream is closed by a TIMEOUT.

Implements dtn::streams::StreamConnection::Callback.

Definition at line 188 of file TCPConnection.cpp.

References dtn::net::ConnectionEvent::CONNECTION_TIMEOUT, and dtn::net::ConnectionEvent::raise().

bool dtn::net::TCPConvergenceLayer::TCPConnection::free (  )  [virtual]

Implements dtn::net::GenericConnection.

Definition at line 50 of file TCPConnection.cpp.

dtn::core::Node::Protocol dtn::net::TCPConvergenceLayer::TCPConnection::getDiscoveryProtocol (  )  const
const StreamContactHeader dtn::net::TCPConvergenceLayer::TCPConnection::getHeader (  )  const

Get the header of this connection

Returns:

Definition at line 61 of file TCPConnection.cpp.

const dtn::core::Node & dtn::net::TCPConvergenceLayer::TCPConnection::getNode (  )  const

Get the associated Node object

Returns:

Definition at line 223 of file TCPConnection.cpp.

Referenced by dtn::net::TCPConvergenceLayer::Server::accept(), and dtn::net::TCPConvergenceLayer::Server::connectionUp().

void dtn::net::TCPConvergenceLayer::TCPConnection::handshake (  )  [protected]
void dtn::net::TCPConvergenceLayer::TCPConnection::iamfree (  ) 

This method sets this instance free. (Mark it for the "garbage collector".)

Definition at line 45 of file TCPConnection.cpp.

Referenced by eventConnectionDown().

void dtn::net::TCPConvergenceLayer::TCPConnection::initialize ( const dtn::data::EID name,
const size_t  timeout = 10 
)

initialize this connection by send and receive the connection header.

Parameters:
header 

Definition at line 81 of file TCPConnection.cpp.

Referenced by dtn::net::TCPConvergenceLayer::Server::accept().

void dtn::net::TCPConvergenceLayer::TCPConnection::queue ( const dtn::data::Bundle bundle  ) 

queue a bundle for this connection

Parameters:
bundle 

Definition at line 56 of file TCPConnection.cpp.

Referenced by dtn::net::TCPConvergenceLayer::Server::queue().

void dtn::net::TCPConvergenceLayer::TCPConnection::rejectTransmission (  )  [protected]

Definition at line 228 of file TCPConnection.cpp.

References dtn::streams::StreamConnection::reject().

Referenced by dtn::net::operator>>().

void dtn::net::TCPConvergenceLayer::TCPConnection::shutdown (  )  [virtual]

shutdown the whole tcp connection

Implements dtn::net::GenericConnection.

Definition at line 218 of file TCPConnection.cpp.

References dtn::streams::StreamConnection::shutdown().

Referenced by ~TCPConnection().


Friends And Related Function Documentation

TCPConvergenceLayer::TCPConnection& operator<< ( TCPConvergenceLayer::TCPConnection conn,
const dtn::data::Bundle bundle 
) [friend]

Definition at line 245 of file TCPConnection.cpp.

Definition at line 233 of file TCPConnection.cpp.


The documentation for this class was generated from the following files:
Generated on Mon Aug 23 08:13:00 2010 for IBR-DTNSuite by  doxygen 1.6.3