My best guess for
issue #285 is send thread being stuck at sendAll function, so I move client removing function before sendAll
--- a/gameServer/ClientIO.hs Wed Sep 21 22:03:31 2011 -0400
+++ b/gameServer/ClientIO.hs Thu Sep 22 11:44:39 2011 +0400
@@ -58,6 +58,10 @@
clientSendLoop :: Socket -> ThreadId -> Chan [B.ByteString] -> ClientIndex -> IO ()
clientSendLoop s tId chan ci = do
answer <- readChan chan
+
+ when (isQuit answer) $
+ killReciever . B.unpack $ quitMessage answer
+
Exception.handle
(\(e :: Exception.IOException) -> unless (isQuit answer) . killReciever $ show e) $
sendAll s $ B.unlines answer `B.snoc` '\n'
@@ -65,7 +69,6 @@
if isQuit answer then
do
Exception.handle (\(_ :: Exception.IOException) -> putStrLn "error on sClose") $ sClose s
- killReciever . B.unpack $ quitMessage answer
else
clientSendLoop s tId chan ci