gameServer/ClientIO.hs
changeset 4998 cdcdf37e5532
parent 4996 76ef3d8bd78e
child 5000 72d8fb26223d
equal deleted inserted replaced
4997:28c670367e6c 4998:cdcdf37e5532
    49 clientRecvLoop s chan ci =
    49 clientRecvLoop s chan ci =
    50     do
    50     do
    51         msg <- (listenLoop s chan ci >> return "Connection closed") `catch` (return . B.pack . show)
    51         msg <- (listenLoop s chan ci >> return "Connection closed") `catch` (return . B.pack . show)
    52         clientOff msg
    52         clientOff msg
    53     `Exception.finally`
    53     `Exception.finally`
       
    54     do
       
    55         clientOff "Connection closed ()"
    54         remove
    56         remove
    55     where
    57     where
    56         clientOff msg = writeChan chan $ ClientMessage (ci, ["QUIT", msg])
    58         clientOff msg = writeChan chan $ ClientMessage (ci, ["QUIT", msg])
    57         remove = writeChan chan $ Remove ci
    59         remove = writeChan chan $ Remove ci
    58 
    60