equal
deleted
inserted
replaced
64 sendAll s $ B.unlines answer `B.append` B.singleton '\n' |
64 sendAll s $ B.unlines answer `B.append` B.singleton '\n' |
65 |
65 |
66 if isQuit answer then |
66 if isQuit answer then |
67 do |
67 do |
68 Exception.handle (\(_ :: Exception.IOException) -> putStrLn "error on sClose") $ sClose s |
68 Exception.handle (\(_ :: Exception.IOException) -> putStrLn "error on sClose") $ sClose s |
69 killReciever "Connection closed" |
69 killReciever . B.unpack $ quitMessage answer |
70 else |
70 else |
71 clientSendLoop s tId cChan chan ci |
71 clientSendLoop s tId cChan chan ci |
72 |
72 |
73 where |
73 where |
74 killReciever = Exception.throwTo tId . ShutdownThreadException |
74 killReciever = Exception.throwTo tId . ShutdownThreadException |
|
75 quitMessage ["BYE"] = "bye" |
|
76 quitMessage ("BYE":msg:_) = msg |
|
77 quitMessage _ = error "quitMessage" |
75 isQuit ("BYE":_) = True |
78 isQuit ("BYE":_) = True |
76 isQuit _ = False |
79 isQuit _ = False |