Hello Cafe.<br><br>I cannot accept socket connection with timeout (Windows, GHC 7.4,1). Consider following code:<br><br>> import Network<br>> import System.Timeout<br>> main = withSocketsDo $ do<br>> print ":: Starting server ..."<br>
> sock <- listenOn (PortNumber 4010)<br>> res <- timeout 1 (accept sock)<br>> print "Timed out" -- Never output!<br>> sClose sock<br><br>Documentation on <a href="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Timeout.html">http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Timeout.html</a> says:"... Standard I/O functions like ... Network.Socket.accept, ... appear to be blocking, but they really don't because the runtime system uses scheduling mechanisms like select(2) to perform asynchronous I/O, so it is possible to interrupt standard socket I/O or file I/O using this combinator." Neither Network.accept, nor Network.Socket.accept can be timed out is example above.<div>
<br></div><div>Is it bug?</div>