#include "SearchEvent.hpp" #include #include #include #include #include #include "../../tasks/types.hpp" #include "../../events/types.hpp" namespace drp { void event::SearchEvent::handle(const packet::GenericPacketContent& content) { packet::GenericPacket packet {}; packet::GenericPacketContent packetContent {}; Information information {}; information.status = task::TaskType::UNDEFINED; packet.channel = 0; packet.securityMode = static_cast(packet::SecurityMode::PLAIN); packetContent.eventType = static_cast(EventType::INFO); std::memcpy(&packetContent.data, &information, sizeof(Information)); packet.setContent(packetContent); if (sendto( clientSocket, &packet, sizeof(packet), 0, serverAddress, serverAddressLength ) == -1) std::cerr << "[Receiver] Could not send information: " << strerror(errno) << std::endl; std::cout << "[Receiver] Sent information." << std::endl; } }