netserver/newhwserv.hs
changeset 898 344ba7dba23d
parent 894 2ca76a7f3121
child 901 2f5ce9a584f9
equal deleted inserted replaced
897:35d91fa3753b 898:344ba7dba23d
    42 
    42 
    43 			clients' <- forM recipients $
    43 			clients' <- forM recipients $
    44 					\ci -> do
    44 					\ci -> do
    45 							forM_ strs (\str -> hPutStrLn (handle ci) str)
    45 							forM_ strs (\str -> hPutStrLn (handle ci) str)
    46 							hFlush (handle ci)
    46 							hFlush (handle ci)
    47 							return []
    47 							if (not $ null strs) && (head strs == "ROOMABANDONED") then hClose (handle ci) >> return [ci] else return []
    48 					`catch` const (hClose (handle ci) >> return [ci])
    48 					`catch` const (hClose (handle ci) >> return [ci])
    49 
    49 
    50 			client' <- if (not $ null strs) && (head strs == "QUIT") then hClose (handle client) >> return [client] else return []
    50 			client' <- if (not $ null strs) && (head strs == "QUIT") then hClose (handle client) >> return [client] else return []
    51 
    51 
    52 			mainLoop servSock acceptChan (remove (remove (mclient : filter (\cl -> handle cl /= handle client) clients) (concat clients')) client') mrooms
    52 			mainLoop servSock acceptChan (remove (remove (mclient : filter (\cl -> handle cl /= handle client) clients) (concat clients')) client') mrooms