IBR-DTNSuite  0.12
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 onUpdateBeacon (const ibrcommon::vinterface &iface, DiscoveryBeacon &announcement) throw (dtn::net::DiscoveryBeaconHandler::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)
 
virtual void resetStats ()
 
virtual void getStats (ConvergenceLayer::stats_data &data) const
 
- Public Member Functions inherited from dtn::net::ConvergenceLayer
virtual ~ConvergenceLayer ()=0
 
virtual void open (const dtn::core::Node &)
 
- 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::DiscoveryBeaconHandler
virtual ~DiscoveryBeaconHandler ()=0
 
virtual void onAdvertiseBeacon (const ibrcommon::vinterface &iface, const DiscoveryBeacon &beacon) throw ()
 
- 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::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::pair< string, string > stats_pair
 
typedef std::map< string, string > stats_data
 

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.

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

Desktruktor

Definition at line 65 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 451 of file UDPConvergenceLayer.cpp.

References ibrcommon::vsocket::down().

Here is the call graph for this function:

void dtn::net::UDPConvergenceLayer::componentDown ( )
throw (
)
protectedvirtual
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 427 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 91 of file UDPConvergenceLayer.cpp.

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

Referenced by getStats().

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

Implements dtn::daemon::Component.

Definition at line 457 of file UDPConvergenceLayer.cpp.

void dtn::net::UDPConvergenceLayer::getStats ( ConvergenceLayer::stats_data data) const
virtual

Reimplemented from dtn::net::ConvergenceLayer.

Definition at line 76 of file UDPConvergenceLayer.cpp.

References getDiscoveryProtocol(), and dtn::core::Node::toString().

Here is the call graph for this function:

void dtn::net::UDPConvergenceLayer::resetStats ( )
virtual

Reimplemented from dtn::net::ConvergenceLayer.

Definition at line 70 of file UDPConvergenceLayer.cpp.


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