The thing is, I also have just relatively short packages to send. But I want to be 100% sure they are actually sent, so the two options are either what I originally wrote, or loop on ::write until it reports all send. The latter doesn't play with the GUI event loop well.
Perhaps my approach is an overkill, but it will only be triggered in very rare cases so maybe that's not too bad?
Bookmarks