Skip to content
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

Optional reference counting #10

Open
ghost opened this issue Sep 29, 2018 · 2 comments
Open

Optional reference counting #10

ghost opened this issue Sep 29, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Sep 29, 2018

Instead of relying strictly on open/close events, a more dynamic resource management can be done with reference counting. Similar to OpenSSL, us_socket_up_ref could be added to ensure a different lifetime for the socket. This together with us_socket_is_closed makes it very useful in cases where you submit the socket to some async queue.

Cost of this could be 1 bit, 1 byte or 2 bytes. More than this, and something is just wrong.

@ghost ghost added the enhancement label Sep 29, 2018
@ghost ghost changed the title Optional reference counting and us_socket_is_closed Optional reference counting Dec 22, 2018
@ghost
Copy link
Author

ghost commented Dec 22, 2018

us_socket_is_closed is implemented

@ghost ghost added the wontfix label Dec 26, 2018
@ghost
Copy link
Author

ghost commented Aug 21, 2020

Optional reference counting can always be implemented in a wrapper.

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

No branches or pull requests

0 participants