equal
deleted
inserted
replaced
33 clientSendLoop :: Handle -> Chan CoreMessage -> Chan [String] -> Int -> IO() |
33 clientSendLoop :: Handle -> Chan CoreMessage -> Chan [String] -> Int -> IO() |
34 clientSendLoop handle coreChan chan clientID = do |
34 clientSendLoop handle coreChan chan clientID = do |
35 answer <- readChan chan |
35 answer <- readChan chan |
36 doClose <- Exception.handle |
36 doClose <- Exception.handle |
37 (\(e :: Exception.IOException) -> if isQuit answer then return True else sendQuit e >> return False) $ do |
37 (\(e :: Exception.IOException) -> if isQuit answer then return True else sendQuit e >> return False) $ do |
38 B.hPutStrLn handle $ BUTF8.fromString $ unlines (answer ++ [""]) |
38 B.hPutStrLn handle $ BUTF8.fromString $ unlines answer |
39 hFlush handle |
39 hFlush handle |
40 return $ isQuit answer |
40 return $ isQuit answer |
41 |
41 |
42 if doClose then |
42 if doClose then |
43 Exception.handle (\(_ :: Exception.IOException) -> putStrLn "error on hClose") $ hClose handle |
43 Exception.handle (\(_ :: Exception.IOException) -> putStrLn "error on hClose") $ hClose handle |
44 else |
44 else |
45 clientSendLoop handle coreChan chan clientID |
45 clientSendLoop handle coreChan chan clientID |