This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Concurrent.Async | |
import Control.Concurrent.Timeout | |
f :: () -> IO Integer | |
f () = f () | |
applyTimeout :: Maybe Integer -> IO a -> IO (Maybe a) | |
applyTimeout Nothing = fmap Just | |
applyTimeout (Just to) = timeout to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
More standard-compliant handling of stream errors | |
RFC 6120 mandates that stream-errors are non-recoverable (4.9.1.1) and the connection should be terminated after such an error. However, Smack's TCP module tries to recover and continues the stream if it manages to get to depth 1. |