X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/261442af210d652fc2c8a3d9197097982701bd16..3c830ad0bc5107acead026251cadd71d08a28308:/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..91608dbb 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,6 +84,9 @@ struct PING_MESSAGE class STG_PINGER { public: + typedef std::multimap PingIPs; + typedef PingIPs::size_type SizeType; + STG_PINGER(time_t delay = 15); ~STG_PINGER(); @@ -91,7 +94,7 @@ public: 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;