[network] #2: Socket related IO cannot be be interrupted on Windows

#2: Socket related IO cannot be be interrupted on Windows ---------------------+------------------------------------------------------ Reporter: igloo | Owner: Type: defect | Status: new Priority: major | Milestone: Component: network | Version: Keywords: | ---------------------+------------------------------------------------------ Originally reported here: http://hackage.haskell.org/trac/ghc/ticket/2943 ---- While playing with socket communication, I noticed that socket IO cannot be interrupted or killed. The attached program simply hangs, irregardless whether is was complied using the -threaded flag or not. {{{ import Network import Control.Concurrent main = withSocketsDo $ do tid <- forkIO $ do s <- listenOn (PortNumber 1234) accept s return () threadDelay 2000000 killThread tid }}} -- Ticket URL: http://trac.haskell.org/network/ticket/2 network http://projects.haskell.org/network/ Networking-related facilities

#2: Socket related IO cannot be be interrupted on Windows ----------------------+----------------------------------------------------- Reporter: igloo | Owner: simonmar Type: defect | Status: assigned Priority: major | Milestone: Component: network | Version: Resolution: | Keywords: ----------------------+----------------------------------------------------- Changes (by simonmar): * owner: => simonmar * status: new => assigned Comment: This is because `accept` makes a safe FFI call on Windows, whereas on Unix it uses `threadWaitRead` to wait for a connection (`threadWaitRead` is interruptible, but not available on Windows). It looks to me like it ought to be interruptible without `-threaded`, I don't completely understand what's going on there. Ideally we would have an IO manager thread on Windows and handle this in the same way as other blocking IO operations, but that's a big job. -- Ticket URL: http://trac.haskell.org/network/ticket/2#comment:1 network http://projects.haskell.org/network/ Networking-related facilities

#2: Socket related IO cannot be be interrupted on Windows ----------------------+----------------------------------------------------- Reporter: igloo | Owner: Type: defect | Status: new Priority: major | Milestone: Component: network | Version: Resolution: | Keywords: ----------------------+----------------------------------------------------- Changes (by simonmar): * owner: simonmar => * status: assigned => new Comment: oops, didn't mean to assign ownership. -- Ticket URL: http://trac.haskell.org/network/ticket/2#comment:2 network http://projects.haskell.org/network/ Networking-related facilities
participants (1)
-
network