@@ -15,6 +15,7 @@ import Network.Transport.TCP
15import Test.Framework (defaultMainWithArgs)
15import Test.Framework (defaultMainWithArgs)
17import Control.Concurrent (threadDelay)
17import Control.Concurrent (threadDelay)
18+import Control.Exception (IOException, try)
18import System.Environment (getArgs)
19import System.Environment (getArgs)
19import System.IO
20import System.IO
@@ -28,8 +29,8 @@ main = do
28 ts <- tests TestTransport
29 ts <- tests TestTransport
29 { testTransport = transport
30 { testTransport = transport
30 , testBreakConnection = \addr1 addr2 -> do
31 , testBreakConnection = \addr1 addr2 -> do
31− sock <- socketBetween internals addr1 addr2
32+ esock <- try $ socketBetween internals addr1 addr2
32− sClose sock
33+ either (\e -> const (return ()) (e :: IOException)) sClose esock
33 threadDelay 10000
34 threadDelay 10000
35 args <- getArgs
36 args <- getArgs