X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/261442af210d652fc2c8a3d9197097982701bd16..3b51da05ef42ecf59b78a6c29664d3e555bc57da:/stglibs/pinger.lib/include/stg/pinger.h diff --git a/stglibs/pinger.lib/include/stg/pinger.h b/stglibs/pinger.lib/include/stg/pinger.h index b1b77781..f31cc270 100644 --- a/stglibs/pinger.lib/include/stg/pinger.h +++ b/stglibs/pinger.lib/include/stg/pinger.h @@ -18,7 +18,7 @@ #include #endif -#if defined (FREE_BSD) || defined (FREE_BSD5) +#if defined (FREE_BSD) || defined (FREE_BSD5) || defined(DARWIN) #include #include #include @@ -84,14 +84,17 @@ struct PING_MESSAGE class STG_PINGER { public: - STG_PINGER(time_t delay = 15); + typedef std::multimap PingIPs; + typedef PingIPs::size_type SizeType; + + explicit STG_PINGER(time_t delay = 15); ~STG_PINGER(); int Start(); int Stop(); void AddIP(uint32_t ip); void DelIP(uint32_t ip); - int GetPingIPNum() const; + SizeType GetPingIPNum() const { return pingIP.size(); } void PrintAllIP(); int GetIPTime(uint32_t ip, time_t * t) const; void SetDelayTime(time_t d) { delay = d; } @@ -108,7 +111,7 @@ private: static void * RunSendPing(void * d); static void * RunRecvPing(void * d); - int delay; + time_t delay; bool nonstop; bool isRunningRecver; bool isRunningSender;