Hi all,
I have a class derived from QUdpSocket. Basically, I just added some functions, nothing of interest.
I iterate through all interfaces on a computer to send local UDP broadcasts.
In a loop, I try to find out if there's any response from a device, therefore I do
Qt Code:
Q_FOREACH(CHD2UdpSocket* socket, udpSockets) { continue; while (socket->hasPendingDatagrams()) { ...To copy to clipboard, switch view to plain text mode
The strange thing is: these are udp sockets, so they are not in a ConnectedState but in a BoundState.
The if statement is false, so the socket is NOT in an UnconnectedState (it's in a BoundState).
But then the socket->hasPendingDiagrams spits out the following debug message
QNativeSocketEngine::hasPendingDiagrams() was called in QAbstractSocket::UnconnectedState.
Any idea what's happening here?
Is it a bug or am I doing something wrong?
Best regards,
Rainer
Bookmarks