first version of InternalUDPService

This commit is contained in:
Henry Winkel
2022-11-12 14:23:12 +01:00
parent 3006f79883
commit 84305eb7fa
16 changed files with 1924 additions and 136 deletions

View File

@@ -1,9 +1,27 @@
#include "WHISPER/InternalUDPService.hpp"
#include "WHISPER/Messages/Message.hpp"
#include <iostream>
#include <loguru.hpp>
#include <WHISPER/Messages/Join.hpp>
#include <WHISPER/Messages/Protos/message.pb.h>
#include <memory>
/// variable for stopping the application
bool running = true;
/**
* @brief killhandler to set running to false on CTRL-C
*
* @param s - the signal to manage
*/
void killHandlerPing(int s) {
if (s == SIGINT) {
running = false;
}
}
int main()
@@ -30,7 +48,12 @@ int main()
LOG_S(INFO)<< "join message data afer reception "<< receivedJoin.port;
break;
}
auto receiver = std::make_shared<WHISPER::threadSafeQueue<WHISPER::Message>>();
WHISPER::InternalUDPService service(1,WHISPER::SHIP,8000,"127.0.0.1");
service.connect(receiver);
while (running) {
std::this_thread::sleep_for(std::chrono::milliseconds(500));
}
return 0;
}