gameServer/ClientIO.hs
changeset 7288 5d0704f23a2a
parent 7252 74a92f39703b
child 7321 57bd4f201401
equal deleted inserted replaced
7188:580cd247511e 7288:5d0704f23a2a
    46     myThreadId >>=
    46     myThreadId >>=
    47     \t -> (restore $ forkIO (clientSendLoop s t clChan ci) >>
    47     \t -> (restore $ forkIO (clientSendLoop s t clChan ci) >>
    48         listenLoop s chan ci >> return "Connection closed")
    48         listenLoop s chan ci >> return "Connection closed")
    49         `Exception.catch` (\(e :: Exception.IOException) -> return . B.pack . show $ e)
    49         `Exception.catch` (\(e :: Exception.IOException) -> return . B.pack . show $ e)
    50         `Exception.catch` (\(e :: ShutdownThreadException) -> return . B.pack . show $ e)
    50         `Exception.catch` (\(e :: ShutdownThreadException) -> return . B.pack . show $ e)
       
    51         `Exception.catch` (\(e :: Exception.SomeException) -> return . B.pack . show $ e)
    51         >>= clientOff >> remove
    52         >>= clientOff >> remove
    52     where
    53     where
    53         clientOff msg = writeChan chan $ ClientMessage (ci, ["QUIT", msg])
    54         clientOff msg = writeChan chan $ ClientMessage (ci, ["QUIT", msg])
    54         remove = writeChan chan $ Remove ci
    55         remove = writeChan chan $ Remove ci
    55 
    56