PING::PING()
: users(nullptr),
isRunning(false),
- onAddUserNotifier(*this),
- onDelUserNotifier(*this),
logger(STG::PluginLogger::get("ping"))
{
}
{
GetUsers();
-users->AddNotifierUserAdd(&onAddUserNotifier);
-users->AddNotifierUserDel(&onDelUserNotifier);
+m_onAddUserConn = users->onAdd([this](auto user){ AddUser(user); });
+m_onDelUserConn = users->onDel([this](auto user){ DelUser(user); });
pinger.SetDelayTime(pingSettings.GetPingDelay());
pinger.Start();
nanosleep(&ts, nullptr);
}
-users->DelNotifierUserAdd(&onAddUserNotifier);
-users->DelNotifierUserDel(&onDelUserNotifier);
+m_onAddUserConn.disconnect();
+m_onDelUserConn.disconnect();
std::list<UserPtr>::iterator users_iter;
users_iter = usersList.begin();
if (newIPS.onlyOneIP())
ping.pinger.AddIP(newIPS[0].ip);
}
-//-----------------------------------------------------------------------------
-void ADD_USER_NONIFIER_PING::notify(const UserPtr & user)
-{
-ping.AddUser(user);
-}
-//-----------------------------------------------------------------------------
-void DEL_USER_NONIFIER_PING::notify(const UserPtr & user)
-{
-ping.DelUser(user);
-}
-//-----------------------------------------------------------------------------