[Haskell-cafe] Re: sendfile leaking descriptors on Linux?
taruti at taruti.net
Tue Feb 16 16:28:38 EST 2010
Excerpts from Bardur Arantsson's message of Tue Feb 16 22:57:23 +0200 2010:
> As far as I can tell, all nonblocking networking code is vulnerable to
> this issue (unless it actually does use threadWaitRead, obviously :)).
There are a few easy fixes:
1) socket timeouts with Network.Socket.setSocketOption
2) just make your server code have timeouts in Haskell
This cannot be fixed in the sendfile library, it is a
feature of TCP that connections may linger for a long
time unless explicit timeouts are used.
So just document it and in your code using sendfile
wrap it in an application specific timeout.
- Taru Karttunen
More information about the Haskell-Cafe