'accept' behavior with an asynchronous exception inside of a 'block'

Cat Dancer ghc-users at catdancer.ws
Wed Dec 6 19:40:30 EST 2006

Chris Kuklewicz suggested I direct this question to the developers ^_^

If I use a network accept inside a block:

  block (
     (clientSocket, sockAddr) <- accept serverSocket

and the 'accept' unblocks a pending asynchronous exception and the
exception gets thrown, does this mean that the 'accept' won't have
accepted a network connection?

Certainly this seems like desirable behavior, since if the 'accept'
call might accept a network connection and *then* raise the
asynchronous exception, the reference to the accepted connection would
be lost.  However I couldn't tell from the library documentation
whether this was intended to be a guarantee of the 'accept' function
or not.

More information about the Glasgow-haskell-users mailing list