mirror of
https://github.com/Telecominfraproject/wlan-cloud-owls.git
synced 2026-01-27 02:22:44 +00:00
35 lines
963 B
C++
35 lines
963 B
C++
//
|
|
// Created by stephane bourque on 2023-04-12.
|
|
//
|
|
#include <Poco/NObserver.h>
|
|
|
|
#include "OWLSclient.h"
|
|
#include "SimulationRunner.h"
|
|
#include "SimStats.h"
|
|
#include "OWLSclientEvents.h"
|
|
|
|
namespace OpenWifi::OWLSClientEvents {
|
|
|
|
void Update(const std::shared_ptr<OWLSclient> &Client, SimulationRunner *Runner) {
|
|
if(!Runner->Running()) {
|
|
return;
|
|
}
|
|
|
|
std::lock_guard ClientGuard(Client->Mutex_);
|
|
|
|
try {
|
|
if(Client->Valid_ && Client->Connected_) {
|
|
Runner->Report().ev_update++;
|
|
Client->Update();
|
|
Runner->Scheduler().in(std::chrono::seconds(30),
|
|
OWLSClientEvents::Update, Client, Runner);
|
|
}
|
|
} catch (const Poco::Exception &E) {
|
|
DEBUG_LINE("exception1");
|
|
Client->Logger().log(E);
|
|
} catch (const std::exception &E) {
|
|
DEBUG_LINE("exception2");
|
|
}
|
|
}
|
|
|
|
} |