Skip to content

Conversation

@inolen
Copy link
Collaborator

@inolen inolen commented Dec 20, 2025

Just hit this after adding a bunch of new assets to a server, which were loaded before the listen socket was setup.

@sbc100
Copy link
Collaborator

sbc100 commented Dec 20, 2025

I'm actually hoping to completely delete this select() implementation in JS and instead simply implement poll() in JS only. We already have a select-on-top-of-poll implemention for wasmfs and my proposed change just moves it. My WIP is here: #25990

FD_SET(server.fd, &fdr);
FD_SET(server.fd, &fdw);
res = select(64, &fdr, &fdw, NULL, &tv);
res = select(FD_SETSIZE, &fdr, &fdw, NULL, &tv);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this is not how select is supposed to work. This should be server.fd + 1 I think,

       nfds   This argument should be set to the highest-numbered file descriptor in any of the three sets, plus 1.  The indicated file descriptors in each set are checked, up
              to this limit (but see BUGS).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be up for making that change instead as a separate PR?

Copy link
Collaborator Author

@inolen inolen Dec 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sbc100 yah, I would expect maxfd + 1 to be passed, but I guess you could technically pass anything up to the max size providing the sets are zero'd out.

I just saw the 64 and changed it to match.

@inolen
Copy link
Collaborator Author

inolen commented Dec 20, 2025

Closing in favor of #25990.

@inolen inolen closed this Dec 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants