
        in this case. Here we implement an algorithm which continuously echoes lines
        back, with a timeout. This example is implemented as a complete function.
      </p>
<pre class="programlisting"><span class="comment">/** This function echoes back received lines from a peer, with a timeout.

    The algorithm terminates upon any error (including timeout).
*/</span>
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Pr