$Author: faust $
*/
-/* inet_aton */
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <csignal>
-#include <cassert>
-#include <cstdio> // fopen and similar
-#include <cstdlib> // strtol
-
#include "stg/common.h"
-#include "stg/locker.h"
#include "stg/const.h" // MONITOR_TIME_DELAY_SEC
#include "traffcounter_impl.h"
#include "stg_timer.h"
#include "users_impl.h"
#include "async_pool.h"
+#include <algorithm>
+#include <csignal>
+#include <cassert>
+#include <cstdio> // fopen and similar
+#include <cstdlib> // strtol
+
+/* inet_aton */
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
#define FLUSH_TIME (10)
#define REMOVE_TIME (31)
m_onIPConns.clear();
//5 seconds to thread stops itself
-struct timespec ts = {0, 200000000};
for (int i = 0; i < 25 && !stopped; i++)
- nanosleep(&ts, NULL);
+ std::this_thread::sleep_for(std::chrono::milliseconds(200));
if (!stopped)
{
int c = 0;
time_t touchTime = stgTime - MONITOR_TIME_DELAY_SEC;
-struct timespec ts = {0, 500000000};
while (!token.stop_requested())
{
- nanosleep(&ts, 0);
+ std::this_thread::sleep_for(std::chrono::milliseconds(500));
if (token.stop_requested())
{
FlushAndRemove();