netserver/newhwserv.hs
changeset 1321 d7dc4e86201e
parent 1309 1a38a967bd48
child 1340 430d210d54ae
equal deleted inserted replaced
1320:bffc7262e25e 1321:d7dc4e86201e
    40 
    40 
    41 
    41 
    42 sendAnswers [] _ clients _ = return clients
    42 sendAnswers [] _ clients _ = return clients
    43 sendAnswers ((handlesFunc, answer):answers) client clients rooms = do
    43 sendAnswers ((handlesFunc, answer):answers) client clients rooms = do
    44 	let recipients = handlesFunc client clients rooms
    44 	let recipients = handlesFunc client clients rooms
    45 	putStrLn ("< " ++ (show answer) ++ " (" ++ (show $ length recipients) ++ " recipients)")
    45 	putStrLn ("< " ++ (show answer))
    46 
    46 
    47 	clHandles' <- forM recipients $
    47 	clHandles' <- forM recipients $
    48 		\ch -> Control.Exception.handle (\e -> putStrLn (show e) >> hClose ch >> return [ch]) $
    48 		\ch -> Control.Exception.handle (\e -> putStrLn (show e) >> hClose ch >> return [ch]) $
    49 			if (not $ null answer) && (head answer == "off") then hClose ch >> return [ch] else -- probably client with exception, don't send him anything
    49 			if (not $ null answer) && (head answer == "off") then hClose ch >> return [ch] else -- probably client with exception, don't send him anything
    50 			do
    50 			do