snoyberg/conduit — Issue #10: Add sourceHandle and sinkHandle to Data.Conduit.Binary
Author: erikd
Created: 2012-01-11 00:53:30+00:00
State: open

Michael,

For full duplex socket operations (eg a telnet client) its necessary to use forkIO like this:

hSetBuffering stdin NoBuffering
hSetBuffering stdout NoBuffering
_ <- forkIO $ runResourceT $ sourceHandle stdin $$ sinkHandle hsock
runResourceT $ sourceHandle hsock $$ sinkHandle stdout

but that requires functions sourceHandle and sinkHandle. If you like this then I'll whip up a patch (I already have working code for these functions).