Readavailable with timeout

Thank you for your answer. It does work, but it creates a Channel, a Timer and a Task for each read operation. It seems to be an overkill.

Probably I could rewrite async_reader to put data into the channel in a loop. But then I would have to use the same timeout for all operations, and it would still create and cancel a Timer object for each read operation, even if there is plenty of data available.

It cannot be efficient. I cannot write speedy network I/O with this. There must be a better way.