Add unsafeFdSocket and touchSocket (Fixes #418)#423
Add unsafeFdSocket and touchSocket (Fixes #418)#423kazu-yamamoto merged 3 commits intohaskell:masterfrom
Conversation
|
Cc: @takano-akio, @fumieval and @bitc |
|
This looks good for my use case 👍 (described in #418). But I am curious what the use case is for "from now on, I only want to work with my ? It would appear to me that the correct way to handle the above scenario would be a function So there must be some other use case for |
No, that use case is not supported, in the present API sockets must be closed via the Socket close function, which must not be bypassed by directly closing the For the latter, one can import qualified System.Posix.IO as P (closeFd, dup)
...
bareFd <- (fdSocket s >>= P.dup) <* close s
-- ... Use bareFd ...
P.closeFd bareFdSince |
Perhaps, there should be a That is the current |
Instead of #422, I would like to merge this one.