I am using Qt5.15 c++, QUdpSocket on Ubuntu 22.04. Testing sending on 3-4 hosts, two of which are disconnected. Sending ~20 packets to each host 25 times per second for several minutes. Each packet is 530 bytes. I am receiving or listening data, only sending.
Wireshark shows that some first packets are sent, and then ~3 seconds delay before the next packets appear. There are no errors in the output log during the first packets being sent, but during the 3 second delay QAbstractSocket::SocketError writes “QAbstractSocket::SocketError(22)”. And it repeats.
I need to send data all the time and if some hosts are disconnected, the rest hosts should receive packets on time.
I tried:
- using the socket bible. The same problem persists there.
- increasing the buffer up to 800MB.
- QAbstractSocket::flush() after each send. The function always returned false.
- adding flags to bind(): ShareAddress, ReuseAddressHint.
- adding options to the socket: SendBufferSizeSocketOption.
I tried using StupidArtnet, which is written in python and uses python’s socket library. As far as I know this library is based on socket.h. And it doesn’t have the buffer problem. I tried to look at socket source code for some flags for the socket, but I didn’t find anything useful.
Axvan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.