@@ -13,7 +13,7 @@ import Data.Word
13import Data.Int
13import Data.Int
14import Data.IORef
14import Data.IORef
15import qualified Data.IntMap as IntMap
15import qualified Data.IntMap as IntMap
16−-- import qualified Data.ByteString.Char8 as BS
16+import qualified Data.ByteString.Char8 as BSS
17import qualified Data.ByteString.Lazy.Char8 as BS
17import qualified Data.ByteString.Lazy.Char8 as BS
19import Data.Binary (encode,decode)
19import Data.Binary (encode,decode)
@@ -80,10 +80,11 @@ mkTransport = do
80 -- Note: Linux fifo semantics are NOT to block on open-RW, but this is not Posix standard.
80 -- Note: Linux fifo semantics are NOT to block on open-RW, but this is not Posix standard.
82 -- We may protect from blocking other threads by running on a separate (OS) thread:
82 -- We may protect from blocking other threads by running on a separate (OS) thread:
83− mv <- onOSThread$ PIO.openFd filename PIO.ReadWrite Nothing PIO.defaultFileFlags
83+-- mv <- onOSThread$ PIO.openFd filename PIO.ReadWrite Nothing PIO.defaultFileFlags
84-- fd <- PIO.openFd filename PIO.ReadWrite Nothing PIO.defaultFileFlags
84-- fd <- PIO.openFd filename PIO.ReadWrite Nothing PIO.defaultFileFlags
85−-- fd <- PIO.openFd filename PIO.WriteOnly Nothing PIO.defaultFileFlags
85+ fd <- PIO.openFd filename PIO.WriteOnly Nothing PIO.defaultFileFlags
86− fd <- takeMVar mv
86+-- fd <- takeMVar mv
87+ dbgprint1$ "GOT WRITING END OPEN ... "
89 -- Write to the named pipe. If the message is less than
90 -- Write to the named pipe. If the message is less than
@@ -130,7 +131,10 @@ mkTransport = do
131 let spinread :: Int64 -> IO BS.ByteString
132 let spinread :: Int64 -> IO BS.ByteString
132 spinread desired = do
133 spinread desired = do
133-- hPutStr stderr "."
135-- hPutStr stderr "."
136+ BSS.hPutStr stdout (BSS.pack$ " "++show desired)
134 (bytes,len) <- oneread desired
138 (bytes,len) <- oneread desired
135 case len of
139 case len of
136 n | n == desired -> return bytes
140 n | n == desired -> return bytes
@@ -151,8 +155,8 @@ mkTransport = do
153#ifdef DEBUG
157#ifdef DEBUG
158+dbgprint1 s = BSS.hPutStrLn stderr (BSS.pack s)
154−dbgprint2 = hPutStrLn stdout
159+dbgprint2 s = BSS.hPutStrLn stdout (BSS.pack s)
155−dbgprint1 = hPutStrLn stderr
157dbgprint1 _ = return ()
161dbgprint1 _ = return ()
158dbgprint2 _ = return ()
162dbgprint2 _ = return ()