IBR-DTNSuite  0.10
dtn::net::UDPConvergenceLayer Class Reference

#include <UDPConvergenceLayer.h>

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

Public Member Functions

 UDPConvergenceLayer (ibrcommon::vinterface net, int port, dtn::data::Length mtu=1280)
 
virtual ~UDPConvergenceLayer ()
 
void update (const ibrcommon::vinterface &iface, DiscoveryAnnouncement &announcement) throw (dtn::net::DiscoveryServiceProvider::NoServiceHereException)
 
dtn::core::Node::Protocol getDiscoveryProtocol () const
 
void queue (const dtn::core::Node &n, const dtn::net::BundleTransfer &job)
 
virtual const std::string getName () const
 
void eventNotify (const ibrcommon::LinkEvent &evt)
 
- Public Member Functions inherited from dtn::net::ConvergenceLayer
virtual ~ConvergenceLayer ()=0
 
virtual void open (const dtn::core::Node &)
 
virtual void resetStats ()
 
virtual const stats_mapgetStats ()
 
- Public Member Functions inherited from dtn::daemon::IndependentComponent
 IndependentComponent ()
 
virtual ~IndependentComponent ()
 
virtual void initialize () throw ()
 
virtual void startup () throw ()
 
virtual void terminate () throw ()
 
- Public Member Functions inherited from dtn::daemon::Component
virtual ~Component ()=0
 
- Public Member Functions inherited from dtn::net::DiscoveryServiceProvider
virtual ~DiscoveryServiceProvider ()
 
- Public Member Functions inherited from ibrcommon::LinkManager::EventCallback
virtual ~EventCallback ()
 

Protected Member Functions

virtual void componentUp () throw ()
 
virtual void componentRun () throw ()
 
virtual void componentDown () throw ()
 
void __cancellation () throw ()
 
- Protected Member Functions inherited from dtn::net::ConvergenceLayer
virtual void addStats (const std::string &tag, const size_t value)
 
virtual void setStats (const std::string &tag, const size_t value)
 
- Protected Member Functions inherited from dtn::daemon::IndependentComponent
void run () throw ()
 
- Protected Member Functions inherited from ibrcommon::JoinableThread
virtual ~JoinableThread ()=0
 
void join (void) throw (ThreadException)
 
bool isRunning (void)
 
void start (int priority=0) throw (ThreadException)
 
void stop () throw ()
 
 JoinableThread (size_t size=DEFAULT_STACKSIZE)
 

Additional Inherited Members

- Public Types inherited from dtn::net::ConvergenceLayer
typedef std::map< std::string,
size_t > 
stats_map
 

Detailed Description

This class implement a ConvergenceLayer for UDP/IP. Each bundle is sent in exact one UDP datagram.

Definition at line 43 of file UDPConvergenceLayer.h.

Constructor & Destructor Documentation

dtn::net::UDPConvergenceLayer::UDPConvergenceLayer ( ibrcommon::vinterface  net,
int  port,
dtn::data::Length  mtu = 1280 
)

Constructor

Parameters
[in]bind_addrThe address to bind.
[in]portThe udp port to use.
[in]broadcastIf true, the broadcast feature for this socket is enabled.
[in]mtuThe maximum bundle size.

Definition at line 60 of file UDPConvergenceLayer.cpp.

References dtn::net::ConvergenceLayer::addStats().

Here is the call graph for this function:

dtn::net::UDPConvergenceLayer::~UDPConvergenceLayer ( )
virtual

Desktruktor

Definition at line 68 of file UDPConvergenceLayer.cpp.

References componentDown().

Here is the call graph for this function:

Member Function Documentation

void dtn::net::UDPConvergenceLayer::__cancellation ( ) throw ()
protectedvirtual

This method is called after componentDown() and should should guarantee that blocking calls in componentRun() will unblock.

Implements dtn::daemon::IndependentComponent.

Definition at line 427 of file UDPConvergenceLayer.cpp.

References ibrcommon::vsocket::down().

Here is the call graph for this function:

void dtn::net::UDPConvergenceLayer::componentDown ( ) throw ()
protectedvirtual

This method is called if the component should stop. Clean-up code should be inserted here.

Implements dtn::daemon::IndependentComponent.

Definition at line 393 of file UDPConvergenceLayer.cpp.

References ibrcommon::vsocket::destroy(), ibrcommon::LinkManager::getInstance(), ibrcommon::JoinableThread::join(), ibrcommon::LinkManager::removeEventListener(), and ibrcommon::JoinableThread::stop().

Referenced by ~UDPConvergenceLayer().

Here is the call graph for this function:

void dtn::net::UDPConvergenceLayer::componentRun ( ) throw ()
protectedvirtual

This is the run method. The component should loop in there until componentDown() or __cancellation() is called.

Implements dtn::daemon::IndependentComponent.

Definition at line 403 of file UDPConvergenceLayer.cpp.

References IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, dtn::net::BundleReceivedEvent::raise(), ibrcommon::LogLevel::warning, ibrcommon::Exception::what(), and ibrcommon::Thread::yield().

Here is the call graph for this function:

dtn::core::Node::Protocol dtn::net::UDPConvergenceLayer::getDiscoveryProtocol ( ) const
virtual

Implements dtn::net::ConvergenceLayer.

Definition at line 73 of file UDPConvergenceLayer.cpp.

References dtn::core::Node::CONN_UDPIP.

const std::string dtn::net::UDPConvergenceLayer::getName ( ) const
virtual
See Also
Component::getName()

Implements dtn::daemon::Component.

Definition at line 433 of file UDPConvergenceLayer.cpp.


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