mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralfms.git
synced 2025-12-29 16:20:50 +00:00
48 lines
1.3 KiB
C++
48 lines
1.3 KiB
C++
//
|
|
// Created by stephane bourque on 2021-07-13.
|
|
//
|
|
|
|
#ifndef UCENTRALFMS_NEWCONNECTIONHANDLER_H
|
|
#define UCENTRALFMS_NEWCONNECTIONHANDLER_H
|
|
|
|
|
|
#include "SubSystemServer.h"
|
|
#include "OpenWifiTypes.h"
|
|
|
|
namespace OpenWifi {
|
|
|
|
class NewConnectionHandler : public SubSystemServer, Poco::Runnable {
|
|
public:
|
|
|
|
static NewConnectionHandler *instance() {
|
|
if (instance_ == nullptr) {
|
|
instance_ = new NewConnectionHandler;
|
|
}
|
|
return instance_;
|
|
}
|
|
|
|
void run() override;
|
|
int Start() override;
|
|
void Stop() override;
|
|
bool Update();
|
|
|
|
void ConnectionReceived( const std::string & Key, const std::string & Message);
|
|
|
|
private:
|
|
static NewConnectionHandler *instance_;
|
|
Poco::Thread Worker_;
|
|
std::atomic_bool Running_ = false;
|
|
int ConnectionWatcherId_=0;
|
|
int HealthcheckWatcherId_=0;
|
|
Types::StringPairQueue NewConnections_;
|
|
|
|
NewConnectionHandler() noexcept:
|
|
SubSystemServer("ConnectionHandler", "NEWCONN-MGR", "connectionhandler") {
|
|
}
|
|
|
|
};
|
|
inline NewConnectionHandler * NewConnectionHandler() { return NewConnectionHandler::instance(); };
|
|
}
|
|
|
|
#endif //UCENTRALFMS_NEWCONNECTIONHANDLER_H
|