
Am 05.08.2010 07:35 schrieb Adolfo Builes:
Hi All:
I have been trying to use System.timeout in windows, but for some reason it doesn't work, a concrete example is:
import Network.HTTP import System.Timeout
main = do rsp <- timeout 10000000 $ simpleHTTP $ getRequest "http://10.1.2.3" case rsp of Just rsp -> print $ show rsp Nothing -> error "Nothing"
In this case I would expect to receive "Nothing" after 10 seconds, but it ignores the timeout function.
Hi Adolfo, the same behaviour for me with GHC 6.10.4 on Windows XP. If I set the timeout value to 0, I get *** Exception: Nothing immediately. Any other value results in *** Exception: connect: failed (Connection timed out (WSAETIMEDOUT)) after about 20 seconds. I don't know where the problem is, but I have similar problems with the threadDelay function. There must be something broken somewhere for some windows systems. Regards, Matthias