When a timeout is set, it cancels any previous read or write timeout for which no outstanding operation is in progress. Algorithms which loop over logical operations simply need to set the timeout once before the logical operation, it is not necessary to call `expires_never` in this case. Here we implement an algorithm which continuously echoes lines back, with a timeout. This example is implemented as a complete function.
When a timeout is set, it cancels any previous read or write timeout for which no outstanding operation is in progress. Algorithms which loop over logical operations simply need to set the timeout once before the logical operation, it is not necessary to call `expires_never` in this case. Here we implement an algorithm which continuously echoes lines back, with a timeout. This example is implemented as a complete function.