I have a server program that uses QUdpSocket.
How do I find the ip address of the sender?
I have a server program that uses QUdpSocket. How do I find the ip
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
From http://doc.qt.io/archives/4.6/qudpsocket.html#readDatagram,
qint64 QUdpSocket::readDatagram ( char * data, qint64 maxSize, QHostAddress * address = 0, quint16 * port = 0 )You pass the addresses of a QHostAddress and a quint16 to the receive function, which get populated with the desired data.