I am writing a DNS server for an application I'm working on and I'm running into some difficulties.
I want to bind to port 53 on localhost and listen for DNS lookup requests, then send back the response. Unfortunately, when I call QUdpSocket::bind() the resulting socket is not writeable. Is there a flag I need to pass to make it so I can send data back?
socket = new QUdpSocket();
connect(socket, SIGNAL(readyRead()), this, SLOT(onReadyRead()), Qt::DirectConnection);
socket->bind(QHostAddress::LocalHost, 53, QUdpSocket::ShareAddress);
Later on, after the connection is established, I want to call one of the QUdpSocket::write* methods, but that is not working as writeable is false..