it is actually more reliable to sleep than to block. by definition blocking is unreliable because you don't know exactly when it will unblock. You do know when a sleep will end though. I also want a variable delay between writes.
Uhhh. I think you need to study this topic some more.
> it is actually more reliable to sleep than to block. by definition blocking is unreliable because you don't know exactly when it will unblock.
A block will end when the nic can handle more data. You can't just wait a second and assume the nic can handle the data. That's where the "unreliable" part comes in. You assume it can handle the data, but you are not checking. And the way to check is either by polling, blocking, or receiving a signal. Waiting is not a way to check.
> You do know when a sleep will end though.
It makes no difference that you know when the sleep will end. It's irrelevant - all you care about is can the nic accept more data or not.
> I also want a variable delay between writes.
If you want variable delays then do that, but that has nothing whatsoever to do with making sure the nic doesn't lose data.