I'm using a QUdpSocket on Windows XP to send some data. At each 10 seconds, I'm sending about 100 to 500 packets each about 50 bytes. I don't have any problem on host sending small amount of packet each times. Problems occurs on host sending 500 packet and more each 10 seconds.
When using writeDatagram(...) I got the error message "Unable to send data". Majority of the 500 packets are sent (checked with wireshark) but some are not sent at all (last ones).
I think the problem occur when the socket's write buffer is full. But I have no idea how to check this with Qt to just wait the buffer to be ready to write more data.
Without Qt, I could use select(...) method to check if the socket is ready and send 1 byte at a time. But how could I check that with QUdpSocket. There's no such method. Also, bytesToWrite() seems to always return zero.
I know I can just sleep and retry but I don't think this method is reliable. The method can failed for other reason. The OS has a good method for this, it's called select().
Thank you for your help.