How to get destination address of a received UDP packet in Qt (solved)
i am able to grab datagram from server but i can't find its destination IP from the UDP received. Can advice how to grab server destination IP and saved it to a variable. How to get destination address of a received UDP packet
udpSocket->readDatagram(datagram.data(),datagram.size()); emit ipDataReceived(datagram);
void socketudp::onUDPportDataReceived(QByteArray UDPdataRec)
There is another method for readDatagram that will achieve receiving sender ip address.
readDatagram(datagram.data(), datagram.size(),&sender, &senderPort);
declare two private variable in the header file