equal
deleted
inserted
replaced
59 |
59 |
60 clientSendLoop :: Socket -> Chan CoreMessage -> Chan [B.ByteString] -> ClientIndex -> IO() |
60 clientSendLoop :: Socket -> Chan CoreMessage -> Chan [B.ByteString] -> ClientIndex -> IO() |
61 clientSendLoop s coreChan chan ci = do |
61 clientSendLoop s coreChan chan ci = do |
62 answer <- readChan chan |
62 answer <- readChan chan |
63 doClose <- Exception.handle |
63 doClose <- Exception.handle |
64 (\(e :: Exception.IOException) -> if isQuit answer then return True else sendQuit e >> return False) $ do |
64 (\(e :: Exception.IOException) -> if isQuit answer then return True else sendQuit e >> return True) $ do |
65 sendAll s $ (B.unlines answer) `B.append` (B.singleton '\n') |
65 sendAll s $ (B.unlines answer) `B.append` (B.singleton '\n') |
66 return $ isQuit answer |
66 return $ isQuit answer |
67 |
67 |
68 if doClose then |
68 if doClose then |
69 Exception.handle (\(_ :: Exception.IOException) -> putStrLn "error on sClose") $ sClose s |
69 Exception.handle (\(_ :: Exception.IOException) -> putStrLn "error on sClose") $ sClose s |