class UpNetworkStatusListener
{
public:
virtual void OnNetworkStatusChanged(bool isConnect) = 0;
};
//网络状态
class UpNetworkStatus
{
public:
UpNetworkStatus();
~UpNetworkStatus();
public:
void* GetWsaCheckEvent(){return m_WsaCheckEvent;}
UpNetworkStatusListener* GetListener(){return m_Listener;}
public:
void StartListen(UpNetworkStatusListener* listener);
static bool GetNetworkConnectStatus();
static bool IsLocalAdapter (const char* pAdapterName);
private:
void* m_WsaCheckEvent;
unsigned long m_ThreadId;
void* m_ListenThread;
UpNetworkStatusListener* m_Listener;
};
#include <string>
#include <winsock2.h>
#include <iphlpapi.h>
//判断是否是当前物理网卡
bool UpNetworkStatus::IsLocalAdapter (const char* pAdapterName)<