Skip to content

Instantly share code, notes, and snippets.

View noschinl's full-sized avatar

Lars 'cebewee' Noschinski noschinl

View GitHub Profile
@noschinl
noschinl / gist:ed6a5cbfd59e4f64d5fb
Last active August 29, 2015 14:09
Timeout does not interrupt
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
@noschinl
noschinl / gist:9383976
Created March 6, 2014 07:10
Smack Issue: More standard-compliant handling of stream errors
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.