mirror of
https://github.com/Telecominfraproject/wlan-cloud-owls.git
synced 2026-03-20 03:40:28 +00:00
28 lines
745 B
C++
28 lines
745 B
C++
//
|
|
// Created by stephane bourque on 2023-04-12.
|
|
//
|
|
|
|
#include "OWLSclient.h"
|
|
#include "SimulationRunner.h"
|
|
#include "SimulationCoordinator.h"
|
|
#include <fmt/format.h>
|
|
#include "OWLSscheduler.h"
|
|
#include "SimStats.h"
|
|
#include <Poco/NObserver.h>
|
|
|
|
#include "OWLSclientEvents.h"
|
|
#include "OWLS_utils.h"
|
|
|
|
namespace OpenWifi::OWLSclientEvents {
|
|
|
|
void Reconnect(std::shared_ptr<OWLSclient> Client, SimulationRunner *Runner) {
|
|
std::lock_guard G(Client->Mutex_);
|
|
|
|
if(Client->Valid_) {
|
|
Runner->Report().ev_reconnect++;
|
|
Client->Connected_ = false;
|
|
OWLSscheduler()->Ref().in(std::chrono::seconds(OWLSutils::local_random(3,15)), OWLSclientEvents::EstablishConnection, Client, Runner);
|
|
}
|
|
}
|
|
|
|
} |