Skip to content
This repository has been archived by the owner on Jun 22, 2021. It is now read-only.

Is there away to call uv_close without close associated file descriptor #188

Open
phpstatic opened this issue Feb 14, 2021 · 3 comments
Open

Comments

@phpstatic
Copy link

I need destroy the uv_poll_t object, but keep the fd alive. is there a way to do this?

@bnoordhuis bnoordhuis transferred this issue from libuv/libuv Feb 14, 2021
@bnoordhuis
Copy link
Member

Yes. In fact, that's the standard mode of operation - you, the libuv user, are responsible for closing the corresponding file descriptor.

@phpstatic
Copy link
Author

phpstatic commented Feb 15, 2021

accord the documents: http://docs.libuv.org/en/v1.x/handle.html uv_close

Handles that wrap file descriptors are closed immediately but close_cb will still be deferred to the next iteration of the event loop. It gives you a chance to free up any resources associated with the handle.

If that's the standard mode of operation, maybe this document should be modifed.

@bnoordhuis
Copy link
Member

I mean it's the standard mode of operation for uv_poll_t. Its documentation mentions how it's different from libuv's general mode of operation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants