-
Notifications
You must be signed in to change notification settings - Fork 63
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
feat: add impl for node sockets (wip) #214
feat: add impl for node sockets (wip) #214
Conversation
12ffdd8
to
8c40715
Compare
49c868b
to
06f068e
Compare
@manekinekko I've updated #154 to reflect the latest WIT definitions. You may want to check your list against that. I believe this should result in slightly less work. The main difference is that the symbols are now namespaced. Plus the manual |
Thanks! |
The wasi-socket WITs have just been updated. Hopefully for the last time before Preview2 |
Thank you @badeend for the heads up :) |
1e9d88e
to
bde9d63
Compare
44426cf
to
429d033
Compare
20ac85e
to
b9e43d7
Compare
This PR adds ~80% of the wasi-socket implementation for node.js. As suggested, we can merge this PR as-is and work on the remaining impl + tests (most of then are tcp/udp stream-related). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per discussion today I'm happy to merge this as soon as the tests are passing and work through follow-up PRs from there.
serializeIpAddress, | ||
} from "./socket-common.js"; | ||
|
||
// TODO: move to a common |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you referring to moving these to the sockets-common.js
file here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct
|
||
this[symbolSocketState].lastErrorState = null; | ||
|
||
const err = this.#socket.listen(this[symbolSocketState].backlogSize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to move to a model where we have the completion callback here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will investigate
@guybedford unit tests are passing. PR should be ready for merge. Will send other PR to migrate to node:net and node:dgram. |
A work in progress PR that adds support for node sockets.
Closes #154 (check issue for progress)