23#ifndef NETWORKMONITOR_H
24#define NETWORKMONITOR_H
32#include <netlistmgr.h>
41 class NetworkMonitor :
public INetworkListManagerEvents
67 ULONG STDMETHODCALLTYPE AddRef()
override;
68 ULONG STDMETHODCALLTYPE Release()
override;
69 HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid,
void** ppvObject)
override;
70 HRESULT STDMETHODCALLTYPE ConnectivityChanged(NLM_CONNECTIVITY newConnectivity)
override;
71 HRESULT STDMETHODCALLTYPE NetworkConnectionPropertyChanged(GUID connectionId, NLM_CONNECTION_PROPERTY_CHANGE newProperty);
78 void checkConnectionState();
79 mutable std::mutex m_mutex;
83 CComPtr<INetworkListManager> m_netListManager;
84 CComPtr<IConnectionPoint> m_connectionPoint;
87 unsigned long m_networkChangedHandlerId;
An event that can have handlers subscribe to it, which in turn will be called when the event is invok...
Definition event.h:49
A monitor of the system's network connection.
Definition networkmonitor.h:45
Events::Event< NetworkStateChangedEventArgs > & stateChanged()
Gets the StateChanged event. This event is invoked whenever the state of the network connection chang...
~NetworkMonitor()
Destructs a NetworkMonitor.
NetworkMonitor()
Constructs a NetworkMonitor. This method will call checkConnectionState() to get the initial system n...
NetworkState getConnectionState() const
Gets the state of the network connection.
NetworkState
States of a network connection.
Definition networkstate.h:32