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

Smart 'dgram.Socket' reuse #777

Merged
merged 3 commits into from
Nov 20, 2023
Merged

Smart 'dgram.Socket' reuse #777

merged 3 commits into from
Nov 20, 2023

Conversation

jwerle
Copy link
Member

@jwerle jwerle commented Nov 20, 2023

This PR introduces a smart mechanism for reusing underlying socket handles by deriving the underlying id from the host and port when port !== 0 and reuseAddr === true such that an already known id was not given to createSocket(). The implementation uses the murmur3 non cryptographic hashing algorithm based on https://github.com/jwerle/murmurhash.c. It uses the current window index as the seed value and the concatenated host + port tuple as an input value. This PR depends on #776

@jwerle jwerle added enhancement New feature or request javascript An issue, discussion, or task related to the runtime javascript api An issue, task, or discussion related to public runtime APIs labels Nov 20, 2023
@jwerle jwerle self-assigned this Nov 20, 2023
test/scripts/test-desktop.js Outdated Show resolved Hide resolved
@jwerle jwerle merged commit 121799f into master Nov 20, 2023
2 of 8 checks passed
@jwerle jwerle deleted the smart-socket-reuse branch November 20, 2023 14:46
@bcomnes
Copy link
Contributor

bcomnes commented Nov 20, 2023

Looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api An issue, task, or discussion related to public runtime APIs enhancement New feature or request javascript An issue, discussion, or task related to the runtime javascript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants