-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add unsafeFdSocket and touchSocket (Fixes #418) #423
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 bareFd Since |
Perhaps, there should be a That is the current |
Instead of #422, I would like to merge this one.