OK - I believe the problem is ARP (an area that has proven to be the CC3000’s Achilles Heel)
If you send packets to a host that exists, or something that is reachable via the default gateway off the local subnet, my testing suggests that you can send packets for ever without a problem.
However, if the designated host is on the local subnet and not available, or the default gateway is unavailable (e.g. the ARP requests go unanswered) - the app will die after ~12 iterations, as reported by @mdma and others.
I have this in captivity on a core with the the SPI bus pinned out for debug, so I can see if the CC3000 is trying to say it has run out of buffers while it is waiting for the ARP response (that is never destined to arrive.)
Can others please verify this behaviour (I’m thinking specifically of @bko & @mdma, but all datapoints are welcome.)
In related news, even @bko 's D0 clause doesn’t seem to work correctly, because the core is now effectlvely unflashable OTA.