Hello Ertugrul Söylemez,<br><br>Good idea -- I've added an ``enumSocketTimed`` and ``iterSocketTimed`` to the network-enumerator package at &lt; http://hackage.haskell.org/package/network-enumerator &gt;. ``enumSocketTimed`` is equivalent to your ``enumHandleTimeout``, but instead of Handle uses the more efficient Socket type.<br><br>For setting a global timeout on an entire session, it's better to wrap the ``run_`` call with ``System.Timeout.timeout`` -- this is more efficient than testing the time on every chunk, and does not require a specialised enumerator.<br><br>The signatures/docs are:<br><br>--------------------------------------------------------<br><br>-- | Enumerate binary data from a 'Socket', using 'recv'. The socket must<br>-- be connected.<br>--<br>-- The buffer size should be a small power of 2, such as 4096.<br>--<br>-- If any call to 'recv' takes longer than the timeout, 'enumSocketTimed'<br>-- will throw an error. To add a timeout for the entire session, wrap the<br>-- call to 'E.run' in 'timeout'.<br>--<br>-- Since: 0.1.2<br>enumSocketTimed :: MonadIO m<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; Integer -- ^ Buffer size&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&gt; Integer -- ^ Timeout, in microseconds<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&gt; S.Socket&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&gt; E.Enumerator B.ByteString m b<br><br>-- | Write data to a 'S.Socket', using 'sendMany'. The socket must be connected.<br>--<br>-- If any call to 'sendMany' takes longer than the timeout, 'iterSocketTimed'<br>-- will throw an error. To add a timeout for the entire session, wrap the<br>-- call to 'E.run' in 'timeout'.<br>--<br>-- Since: 0.1.2<br>iterSocketTimed :: MonadIO m<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; Integer -- ^ Timeout, in microseconds<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&gt; S.Socket<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&gt; E.Iteratee B.ByteString m ()<br><br>
--------------------------------------------------------<br>