Skip to content

Conversation

@devnexen
Copy link
Member

going from 128 to system's SOMAXCONN by default to be able to increase the queue of connections to be handled.

@devnexen devnexen force-pushed the socket_listen_update branch 2 times, most recently from 296f464 to 070ebbc Compare March 31, 2024 16:27
@nielsdos
Copy link
Member

nielsdos commented Mar 31, 2024

I don't know what the real consequences are for applications that expect the default to be 128, and therefore don't pass the argument.

@devnexen
Copy link
Member Author

devnexen commented Mar 31, 2024

The doc never mentions 128, it was kind of enough back in the day. However the doc does mention SOMAXCONN can be passed I just made it default. Besides, for Haiku, SOMAXCONN is 32.

@nielsdos
Copy link
Member

Well, it looks like the docs have the 128 in the signature, so people could theoretically rely on that limit.
But that may not be of a big concern.
Anyway, that does mean though that this should be updated:

function socket_create_listen(int $port, int $backlog = 128): Socket|false {}

@devnexen devnexen force-pushed the socket_listen_update branch from 070ebbc to 65c4725 Compare March 31, 2024 19:34
@devnexen devnexen requested a review from kocsismate as a code owner March 31, 2024 19:34
UPGRADING Outdated
. pg_select, the conditions arguments accepts an empty array and is optional.

- Sockets:
. socket_create_listen backlog argument default value had been changed to
Copy link
Member

@kocsismate kocsismate Apr 9, 2024

Choose a reason for hiding this comment

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

What about this?

Suggested change
. socket_create_listen backlog argument default value had been changed to
. Parameter $backlog of socket_create_listen() now has a default value of SOMAXCONN.
Previously, it was 128.

@devnexen devnexen force-pushed the socket_listen_update branch from 65c4725 to f61d614 Compare April 9, 2024 20:16
Copy link
Member

@kocsismate kocsismate left a comment

Choose a reason for hiding this comment

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

LGTM! I cannot guess the BC impact of this change, but personally, I'm fine with it.

@devnexen
Copy link
Member Author

I did similar-ish change in the rust std library about 2 years ago (and you can t even change the backlog value there), seems alright I m relatively confident. Anyhow, on libc like musl, SOMAXCONN is still 128 ;)

going from 128 to system's SOMAXCONN by default to be able to increase
the queue of connections to be handled.
Also, for Haiku SOMAXCONN is only 32.
@devnexen devnexen force-pushed the socket_listen_update branch from f61d614 to 6f48fd3 Compare April 10, 2024 17:06
Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

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

Okay, sounds good then; thanks!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants