equal
deleted
inserted
replaced
42 |
42 |
43 sendPacket packet = writeChan chan $ ClientMessage (ci, packet) |
43 sendPacket packet = writeChan chan $ ClientMessage (ci, packet) |
44 |
44 |
45 clientRecvLoop :: Socket -> Chan CoreMessage -> ClientIndex -> IO () |
45 clientRecvLoop :: Socket -> Chan CoreMessage -> ClientIndex -> IO () |
46 clientRecvLoop s chan ci = |
46 clientRecvLoop s chan ci = |
47 (listenLoop s chan ci >> return "Connection closed") `catch` (return . B.pack . show) >>= clientOff >> remove |
47 (listenLoop s chan ci >> return "Connection closed") |
|
48 `Exception.catch` (\(e :: ShutdownThreadException) -> return . B.pack . show $ e) |
|
49 `Exception.catch` (\(e :: Exception.IOException) -> return . B.pack . show $ e) |
|
50 >>= clientOff >> remove |
48 where |
51 where |
49 clientOff msg = writeChan chan $ ClientMessage (ci, ["QUIT", msg]) |
52 clientOff msg = writeChan chan $ ClientMessage (ci, ["QUIT", msg]) |
50 remove = writeChan chan $ Remove ci |
53 remove = writeChan chan $ Remove ci |
51 |
54 |
52 |
55 |