@@ -15,6 +15,7 @@ import Network.Transport.TCP
1515import Test.Framework (defaultMainWithArgs)
1616
1717import Control.Concurrent (threadDelay)
18+import Control.Exception (IOException, try)
1819import System.Environment (getArgs)
1920import System.IO
2021
@@ -28,8 +29,8 @@ main = do
2829 ts <- tests TestTransport
2930 { testTransport = transport
3031 , testBreakConnection = \addr1 addr2 -> do
31− sock <- socketBetween internals addr1 addr2
32− sClose sock
32+ esock <- try $ socketBetween internals addr1 addr2
33+ either (\e -> const (return ()) (e :: IOException)) sClose esock
3334 threadDelay 10000
3435 }
3536 args <- getArgs