It does not do that in my environment (Linux 64-bit, GCC 6, Qt 5.7.1). Built code as supplied. Does nothing other than create empty file until a UDP datagram is received. Using netcat sent the 519-byte PRO file as a datagram: 4000 bytes written to file. Repeated: 8000 bytes in file etc.

Are you certain this program is the problem? Is the sender you are testing with also on this machine?