NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::util::NetworkMonitor Class Reference

Network state change monitor. More...

#include <network-monitor.hpp>

Inheritance diagram for ndn::util::NetworkMonitor:
Collaboration diagram for ndn::util::NetworkMonitor:

Classes

class  Error
 
class  Impl
 

Public Member Functions

 NetworkMonitor (boost::asio::io_service &io)
 Construct instance and start monitoring for network state changes. More...
 
 ~NetworkMonitor ()
 Terminate network state monitoring. More...
 

Public Attributes

Signal< NetworkMonitoronNetworkStateChanged
 

Detailed Description

Network state change monitor.

When network change is detected, onNetworkStateChanged signal will be fired. Monitoring is run for the lifetime of the NetworkMonitor instance.

Note
Implementation of this class is platform dependent and not all supported platforms are supported:
  • OS X: CFNotificationCenterAddObserver
  • Linux: rtnetlink notifications

Network state change detection is not guaranteed to be precise and (zero or more) notifications are expected to be fired for the following events:

  • any network interface going up or down
  • IPv4 or IPv6 address changes on any of the interfaces

Definition at line 48 of file network-monitor.hpp.

Constructor & Destructor Documentation

ndn::util::NetworkMonitor::NetworkMonitor ( boost::asio::io_service &  io)
explicit

Construct instance and start monitoring for network state changes.

Parameters
ioio_service thread that will dispatch events
Exceptions
Errorwhen network monitoring is not supported or there is an error starting monitoring

Definition at line 242 of file network-monitor.cpp.

Referenced by ndn::util::NetworkMonitor::Error::Error().

ndn::util::NetworkMonitor::~NetworkMonitor ( )

Terminate network state monitoring.

Definition at line 247 of file network-monitor.cpp.

Referenced by ndn::util::NetworkMonitor::Error::Error().

Member Data Documentation

Signal<NetworkMonitor> ndn::util::NetworkMonitor::onNetworkStateChanged

Definition at line 74 of file network-monitor.hpp.

Referenced by nfd::Nfd::initialize().


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