-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Enumerator tools for text-based network protocols -- -- Enumerator tools for text-based network protocols. This includes, -- among other things, an enumeratee to split an incoming ByteString -- stream to a length-limited line stream in a safe manner (i.e. in -- constant space). @package netlines @version 0.2.1 -- | Enumerator tools for working with text-based network protocols. module Network.NetLines -- | Savely read a line with the given maximum length. If a longer line is -- enumerated, the excess data is dropped in constant space. Returns -- Nothing on EOF. -- -- Please note that this function is very error-tolerant in the way it -- handles line endings. Both CR and LF are proper line terminators. This -- function ignores empty lines. netLine :: Monad m => Int -> MaybeT r (Iteratee ByteString m) ByteString -- | Convert a stream of bytes to a stream of lines with the given maximum -- length. Longer lines are silently truncated in constant space. netLines :: Monad m => Int -> Enumeratee ByteString ByteString m b -- | Variant of netLine, which supports empty lines, useful for -- protocols like HTTP, in which empty lines have a special meaning. This -- function splits the input stream by LF characters while ignoring CR -- characters. netLineEmpty :: Monad m => Int -> MaybeT r (Iteratee ByteString m) ByteString -- | This is the same like netLines, but is based on -- netLinesEmpty to support empty lines. netLinesEmpty :: Monad m => Int -> Enumeratee ByteString ByteString m b -- | Enumerate from a handle with the given buffer size (first argument) -- and timeout in milliseconds (second argument). If the timeout is -- exceeded an exception is thrown via throwError. enumHandleTimeout :: MonadIO m => Int -> Int -> Handle -> Enumerator ByteString m b