steamclock / bluejay

A simple Swift framework for building reliable Bluetooth LE apps.
MIT License
1.09k stars 98 forks source link

Timeouts on listens should probably apply to "time since last receive" not entire operation. #241

Open nbrooke opened 4 years ago

nbrooke commented 4 years ago

When you set a timeout for a listen, the timeout applies to the time since the operation started, but in most cases it would make more sense for it to apply to the time since the last successful received data. Otherwise, there is no way to have a reasonable timeout on large data downloads, because you either need to set the time to something very large to make sure it has time to complete (in which case it will take a long time to error out) or if you set the timeout to short, you can get cancelled due to a time out while you are int e middle of actively receiving data.