uNetworking / uNetworking/uSockets

Optional reference counting

Open
#10 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement wontfix
Dominant language
C
Stars
1.5k
Forks
307
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the existing socket lifetime and open/close handling, then locate the public API around us_socket_up_ref and us_socket_is_closed. Define the reference-counting design and its storage cost before implementing it, and verify that sockets submitted to an async queue can remain valid until their references are released.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.