netserver/newhwserv.hs
changeset 1302 4290ba4a14ca
parent 1082 596b1dcdc1df
child 1304 05cebf68ebd8
equal deleted inserted replaced
1301:c6fe8a4bfd34 1302:4290ba4a14ca
    40 	r <- atomically $ (Left `fmap` readTChan acceptChan) `orElse` (Right `fmap` tselect clients)
    40 	r <- atomically $ (Left `fmap` readTChan acceptChan) `orElse` (Right `fmap` tselect clients)
    41 	case r of
    41 	case r of
    42 		Left ci -> do
    42 		Left ci -> do
    43 			mainLoop servSock acceptChan (ci:clients) rooms
    43 			mainLoop servSock acceptChan (ci:clients) rooms
    44 		Right (cmd, client) -> do
    44 		Right (cmd, client) -> do
    45 			print ("> " ++ show cmd)
    45 			putStrLn ("> " ++ show cmd)
    46 			let (clientsFunc, roomsFunc, handlesFunc, answer) = handleCmd client clients rooms $ cmd
    46 			let (clientsFunc, roomsFunc, handlesFunc, answer) = handleCmd client clients rooms $ cmd
    47 			print ("< " ++ show answer)
    47 			putStrLn ("< " ++ show answer)
    48 
    48 
    49 			let mclients = clientsFunc clients
    49 			let mclients = clientsFunc clients
    50 			let mrooms = roomsFunc rooms
    50 			let mrooms = roomsFunc rooms
    51 			let recipients = handlesFunc client clients rooms
    51 			let recipients = handlesFunc client clients rooms
    52 			
    52