Make client quit on send exception (was commented due to another approach in handling connection lost) server_refactor
authorunc0rr
Fri, 28 Jan 2011 22:34:07 +0300
branchserver_refactor
changeset 4608 d0f758d0ff91
parent 4606 4c521c4ab2b6
child 4610 9541b2a76067
Make client quit on send exception (was commented due to another approach in handling connection lost)
gameServer/ClientIO.hs
--- a/gameServer/ClientIO.hs	Fri Jan 28 22:21:29 2011 +0300
+++ b/gameServer/ClientIO.hs	Fri Jan 28 22:34:07 2011 +0300
@@ -73,7 +73,8 @@
         clientSendLoop s tId coreChan chan ci
 
     where
-        --sendQuit e = writeChan coreChan $ ClientMessage (ci, ["QUIT", B.pack $ show e])
-        sendQuit e = putStrLn $ show e
+        sendQuit e = do
+            putStrLn $ show e
+            writeChan coreChan $ ClientMessage (ci, ["QUIT", B.pack $ show e])
         isQuit ("BYE":xs) = True
         isQuit _ = False