IBR-DTN  1.0.0
dtn::net::TCPConnection Class Reference

#include <TCPConnection.h>

Inheritance diagram for dtn::net::TCPConnection:
Inheritance graph
Collaboration diagram for dtn::net::TCPConnection:
Collaboration graph

Public Member Functions

 TCPConnection (TCPConvergenceLayer &tcpsrv, const dtn::core::Node &node, ibrcommon::clientsocket *sock, const size_t timeout=10)
 
virtual ~TCPConnection ()
 
virtual void initialize () throw ()
 
void shutdown () throw ()
 
const
dtn::streams::StreamContactHeader
getHeader () const
 
const dtn::core::NodegetNode () const
 
virtual void eventShutdown (dtn::streams::StreamConnection::ConnectionShutdownCases csc) throw ()
 
virtual void eventTimeout () throw ()
 
virtual void eventError () throw ()
 
virtual void eventConnectionUp (const dtn::streams::StreamContactHeader &header) throw ()
 
virtual void eventConnectionDown () throw ()
 
virtual void eventBundleRefused () throw ()
 
virtual void eventBundleForwarded () throw ()
 
virtual void eventBundleAck (const dtn::data::Length &ack) throw ()
 
virtual void addTrafficIn (size_t) throw ()
 
virtual void addTrafficOut (size_t) throw ()
 
dtn::core::Node::Protocol getDiscoveryProtocol () const
 
void queue (const dtn::net::BundleTransfer &job)
 
bool match (const dtn::core::Node &n) const
 
bool match (const dtn::data::EID &destination) const
 
bool match (const dtn::core::NodeEvent &evt) const
 

Protected Member Functions

void rejectTransmission ()
 
void setup () throw ()
 
void connect ()
 
void run () throw ()
 
void finally () throw ()
 
void __cancellation () throw ()
 
void clearQueue ()
 
void keepalive ()
 
bool good () const
 
void initiateExtendedHandshake () throw (ibrcommon::Exception)
 

Detailed Description

Definition at line 48 of file TCPConnection.h.

Constructor & Destructor Documentation

dtn::net::TCPConnection::TCPConnection ( TCPConvergenceLayer tcpsrv,
const dtn::core::Node node,
ibrcommon::clientsocket *  sock,
const size_t  timeout = 10 
)

Constructor for a new TCPConnection object.

Parameters
tcpsrv
streamTCP stream to talk to the other peer.
name
timeout
Returns

Definition at line 61 of file TCPConnection.cpp.

dtn::net::TCPConnection::~TCPConnection ( )
virtual

Destructor

Returns

Definition at line 68 of file TCPConnection.cpp.

Member Function Documentation

void dtn::net::TCPConnection::__cancellation ( )
throw (
)
protected

Definition at line 358 of file TCPConnection.cpp.

void dtn::net::TCPConnection::addTrafficIn ( size_t  )
throw (
)
virtual

Reports inbound traffic amount

Reimplemented from dtn::streams::StreamConnection::Callback.

Definition at line 323 of file TCPConnection.cpp.

void dtn::net::TCPConnection::addTrafficOut ( size_t  )
throw (
)
virtual

Reports outbound traffic amount

Reimplemented from dtn::streams::StreamConnection::Callback.

Definition at line 328 of file TCPConnection.cpp.

void dtn::net::TCPConnection::eventBundleAck ( const dtn::data::Length ack)
throw (
)
virtual

This method is called if a ACK is received.

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

Definition at line 318 of file TCPConnection.cpp.

void dtn::net::TCPConnection::eventBundleForwarded ( )
throw (
)
virtual

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

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

Definition at line 295 of file TCPConnection.cpp.

References dtn::net::BundleTransfer::complete().

Here is the call graph for this function:

void dtn::net::TCPConnection::eventBundleRefused ( )
throw (
)
virtual

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

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

Definition at line 272 of file TCPConnection.cpp.

References dtn::net::BundleTransfer::abort(), and dtn::net::TransferAbortedEvent::REASON_REFUSED.

Here is the call graph for this function:

void dtn::net::TCPConnection::eventConnectionDown ( )
throw (
)
virtual

This method is called if a connection went down.

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

Definition at line 251 of file TCPConnection.cpp.

References dtn::streams::StreamContactHeader::_localeid, dtn::net::ConnectionEvent::CONNECTION_DOWN, and dtn::net::ConnectionEvent::raise().

Here is the call graph for this function:

void dtn::net::TCPConnection::eventConnectionUp ( const dtn::streams::StreamContactHeader header)
throw (
)
virtual
void dtn::net::TCPConnection::eventError ( )
throw (
)
virtual

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

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

Definition at line 131 of file TCPConnection.cpp.

void dtn::net::TCPConnection::eventShutdown ( dtn::streams::StreamConnection::ConnectionShutdownCases  csc)
throw (
)
virtual

callback methods for tcpstream

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

Definition at line 114 of file TCPConnection.cpp.

void dtn::net::TCPConnection::eventTimeout ( )
throw (
)
virtual

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

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

Definition at line 118 of file TCPConnection.cpp.

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

Here is the call graph for this function:

void dtn::net::TCPConnection::finally ( )
throw (
)
protected

Definition at line 367 of file TCPConnection.cpp.

References clearQueue().

Here is the call graph for this function:

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

Get the header of this connection

Returns

Definition at line 99 of file TCPConnection.cpp.

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

Get the associated Node object

Returns

Definition at line 104 of file TCPConnection.cpp.

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

bool dtn::net::TCPConnection::good ( ) const
protected

Definition at line 800 of file TCPConnection.cpp.

void dtn::net::TCPConnection::initialize ( )
throw (
)
virtual
void dtn::net::TCPConnection::keepalive ( )
protected

Definition at line 795 of file TCPConnection.cpp.

bool dtn::net::TCPConnection::match ( const dtn::core::Node n) const
bool dtn::net::TCPConnection::match ( const dtn::data::EID destination) const

Definition at line 814 of file TCPConnection.cpp.

References dtn::core::Node::getEID(), and dtn::data::EID::sameHost().

Here is the call graph for this function:

bool dtn::net::TCPConnection::match ( const dtn::core::NodeEvent evt) const

Definition at line 819 of file TCPConnection.cpp.

References dtn::core::NodeEvent::getNode(), and match().

Here is the call graph for this function:

void dtn::net::TCPConnection::queue ( const dtn::net::BundleTransfer job)

queue a bundle for this connection

Parameters
bundle

Definition at line 94 of file TCPConnection.cpp.

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

void dtn::net::TCPConnection::rejectTransmission ( )
protected

Definition at line 109 of file TCPConnection.cpp.

Referenced by run().

void dtn::net::TCPConnection::shutdown ( )
throw (
)

shutdown the whole tcp connection

Definition at line 343 of file TCPConnection.cpp.

References dtn::streams::StreamConnection::CONNECTION_SHUTDOWN_ERROR.

Referenced by connect(), and run().


The documentation for this class was generated from the following files: