3 ms·
In that case you don't want to sleep. You want to wait until a condition (new data) or a timeout (100ms) occurs. The reasoning is that you don't know how much
by std_throwaway 12y ago
In that case you don't want to sleep. You want to wait until a condition (new data) or a timeout (100ms) occurs.
The reasoning is that you don't know how much data will arrive in the next 100ms and if you sleep either a buffer could overrun or something else could block. Therefore you need to flush the buffer either when enough data has accumulated or if a timeout has occured.
- functional_test 12y agoI can see where you're coming from. For my particular apication that's not a concern (and I have sequence numbers to know when I've dropped data).