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

backlog parameter #31

Open
Lintkey opened this issue Jan 24, 2023 · 1 comment
Open

backlog parameter #31

Lintkey opened this issue Jan 24, 2023 · 1 comment

Comments

@Lintkey
Copy link

Lintkey commented Jan 24, 2023

In src\os\unix\listener.rs:88~92

        // FIXME the standard library uses 128 here without an option to change this
        // number, why? If std has solid reasons to do this, remove this notice and
        // document the method's behavior on this matter explicitly; otherwise, add
        // an option to change this value.
        c_wrappers::listen(&fd, 128)?;

The size of the accept queue is equal to min(SOMAXCONN, backlog), by default SOMAXCONN=128.

SOMAXCONN: socket max connections, man page.

@kotauskas
Copy link
Owner

Interesting find, but it makes it even more confusing how the standard library just puts a fixed value of 128 there. In this case, I'd like to introduce an optional parameter to specify the value for exotic use cases where SOMAXCONN is raised via /proc/sys/net/core/somaxconn and the server program depends on the increased backlog.

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

No branches or pull requests

2 participants