gameServer/ClientIO.hs
changeset 7252 74a92f39703b
parent 5989 23407ecb1826
child 7321 57bd4f201401
equal deleted inserted replaced
7250:304d3d98662e 7252:74a92f39703b
    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