netserver/hedgewars-server.hs
changeset 1469 5218aa76939e
parent 1468 6e6a75de2fc9
child 1473 60e1fad78d58
--- a/netserver/hedgewars-server.hs	Mon Nov 03 14:47:23 2008 +0000
+++ b/netserver/hedgewars-server.hs	Tue Nov 04 14:43:31 2008 +0000
@@ -28,13 +28,12 @@
 	atomically $ writeTChan messagesChan ["PING"]
 
 acceptLoop :: Socket -> TChan ClientInfo -> IO ()
-acceptLoop servSock acceptChan = do
+acceptLoop servSock acceptChan = Control.Exception.handle (const $ putStrLn "exception on connect" >> acceptLoop servSock acceptChan) $ do
 	(cHandle, host, port) <- accept servSock
-	hPutStrLn cHandle "CONNECTED\n"
-	hFlush cHandle
 	cChan <- atomically newTChan
 	forkIO $ clientLoop cHandle cChan
 	atomically $ writeTChan acceptChan (ClientInfo cChan cHandle "" 0 "" False False False)
+	atomically $ writeTChan cChan ["ASKME"]
 	acceptLoop servSock acceptChan