NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: 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 53 of file network-monitor.hpp.

Constructor & Destructor Documentation

◆ NetworkMonitor()

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 52 of file network-monitor.cpp.

References ~NetworkMonitor().

◆ ~NetworkMonitor()

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

Terminate network state monitoring.

Referenced by NetworkMonitor().

Member Data Documentation

◆ onNetworkStateChanged

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

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


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