libnick 2025.1.0
A cross-platform base for native Nickvision applications.
Loading...
Searching...
No Matches
Nickvision::Network::NetworkMonitor Class Reference

A monitor of the system's network connection. More...

#include <networkmonitor.h>

Inheritance diagram for Nickvision::Network::NetworkMonitor:

Public Member Functions

 NetworkMonitor ()
 Constructs a NetworkMonitor. This method will call checkConnectionState() to get the initial system network state.
 
 ~NetworkMonitor ()
 Destructs a NetworkMonitor.
 
Events::Event< NetworkStateChangedEventArgs > & stateChanged ()
 Gets the StateChanged event. This event is invoked whenever the state of the network connection changes.
 
NetworkState getConnectionState () const
 Gets the state of the network connection.
 
ULONG STDMETHODCALLTYPE AddRef () override
 
ULONG STDMETHODCALLTYPE Release () override
 
HRESULT STDMETHODCALLTYPE QueryInterface (REFIID riid, void **ppvObject) override
 
HRESULT STDMETHODCALLTYPE ConnectivityChanged (NLM_CONNECTIVITY newConnectivity) override
 
HRESULT STDMETHODCALLTYPE NetworkConnectionPropertyChanged (GUID connectionId, NLM_CONNECTION_PROPERTY_CHANGE newProperty)
 

Detailed Description

A monitor of the system's network connection.

Constructor & Destructor Documentation

◆ NetworkMonitor()

Nickvision::Network::NetworkMonitor::NetworkMonitor ( )

Constructs a NetworkMonitor. This method will call checkConnectionState() to get the initial system network state.

Exceptions
std::runtime_errorThrown if unable to create the NetworkMonitor

◆ ~NetworkMonitor()

Nickvision::Network::NetworkMonitor::~NetworkMonitor ( )

Destructs a NetworkMonitor.

Member Function Documentation

◆ AddRef()

ULONG STDMETHODCALLTYPE Nickvision::Network::NetworkMonitor::AddRef ( )
override

◆ ConnectivityChanged()

HRESULT STDMETHODCALLTYPE Nickvision::Network::NetworkMonitor::ConnectivityChanged ( NLM_CONNECTIVITY newConnectivity)
override

◆ getConnectionState()

NetworkState Nickvision::Network::NetworkMonitor::getConnectionState ( ) const

Gets the state of the network connection.

Returns
NetworkState

◆ NetworkConnectionPropertyChanged()

HRESULT STDMETHODCALLTYPE Nickvision::Network::NetworkMonitor::NetworkConnectionPropertyChanged ( GUID connectionId,
NLM_CONNECTION_PROPERTY_CHANGE newProperty )

◆ QueryInterface()

HRESULT STDMETHODCALLTYPE Nickvision::Network::NetworkMonitor::QueryInterface ( REFIID riid,
void ** ppvObject )
override

◆ Release()

ULONG STDMETHODCALLTYPE Nickvision::Network::NetworkMonitor::Release ( )
override

◆ stateChanged()

Events::Event< NetworkStateChangedEventArgs > & Nickvision::Network::NetworkMonitor::stateChanged ( )

Gets the StateChanged event. This event is invoked whenever the state of the network connection changes.

Returns
The StateChanged event

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