I've spent pretty much a whole day on this....
I have a little (ARM-based) Linux (Ubuntu) box connected wirelessly to my LAN.
Every minute (via cron) it runs a script which opens a UDP port, then sends a UDP message every second (for 59s) logging the result.
For hours I could not work out why more often than not, the script would lock up to 45s then hang - subsequent runs would fail because the port was still held open, and I had to kill the previous instance of the script to get things working again. If I put delays in the script so it didn't do anything for the first (say) 40s, then it still failed at 45s. If I removed the delays so it ran all 60 requests without gaps, they all completed fine (in a couple of seconds).
Then on a whim I rebooted and nothing changed, except that the 45s became 38s.
Then on another whim, I plugged in a network cable and it's been stable since.
So, what might be happening every minute that would cause an existing UDP "connection"[1] to fail? Looking at syslog, the 38s ties in with when NetworkMangler brought the wireless connection up (with dhcp).
If it's likely to be hardware specific then I'll probably just change the hardware, but I'd like this to work wirelessly and if there's something happening behind the scenes that could cause this I'd like some clues as to what it might be!
[1] Yes, UDP is connectionless so this phrase is a bit meaningless. Hopefully you know what I mean.