Socket Options

Peter Simons simons at cryp.to
Mon Jun 28 08:17:21 EDT 2004


Simon Marlow writes:

 > The runtime uses non-blocking I/O and select() internally
 > in order to support multi-threaded I/O. We don't have any
 > direct support for timeouts [...]

Thanks for the clarification. I understand that.

But what would happen if I _do_ set a timeout on the socket
level nonetheless? The timeout would strike in form of a
read() or write() call returning -1 with an errno of
ETIMEDOUT, so clearly it would be noticed by the RTS. The
question is: will the RTS report the failure to me through
an asynchronous exception?

Because if it does, then that is all the "support" I'll ever
need, it saves me from 'forkIO'ing a racer thread for every
operation that might time out.

Peter


More information about the Glasgow-haskell-users mailing list