--- hedgewars-src-0.9.9/netserver/hedgewars-server.hs +++ hedgewars-src-0.9.9/netserver/hedgewars-server.hs @@ -7,7 +7,7 @@ import IO import System.IO import Control.Concurrent import Control.Concurrent.STM -import Control.Exception (handle, finally, Exception, IOException) +import Control.OldException (handle, finally, Exception, IOException) import Control.Monad import Maybe (fromMaybe, isJust, fromJust) import Data.List @@ -39,7 +39,7 @@ timerLoop messagesChan = forever $ do acceptLoop :: Socket -> TChan ClientInfo -> IO () acceptLoop servSock acceptChan = - Control.Exception.handle (\(_ :: Exception) -> putStrLn "exception on connect" >> acceptLoop servSock acceptChan) $ + Control.OldException.handle (\(_ :: Exception) -> putStrLn "exception on connect" >> acceptLoop servSock acceptChan) $ do (cHandle, host, _) <- accept servSock @@ -89,7 +89,7 @@ clientRecvLoop handle chan = clientSendLoop :: Handle -> TChan[String] -> TChan[String] -> IO() clientSendLoop handle clChan chan = do answer <- atomically $ readTChan chan - doClose <- Control.Exception.handle + doClose <- Control.OldException.handle (\(e :: Exception) -> if isQuit answer then return True else sendQuit e >> return False) $ do forM_ answer (\str -> hPutStrLn handle str) hPutStrLn handle "" @@ -97,7 +97,7 @@ clientSendLoop handle clChan chan = do return $ isQuit answer if doClose then - Control.Exception.handle (\(_ :: Exception) -> putStrLn "error on hClose") $ hClose handle + Control.OldException.handle (\(_ :: Exception) -> putStrLn "error on hClose") $ hClose handle else clientSendLoop handle clChan chan