Skip to content

avoid setting socket listen backlog to 1, handle more concurrent conns - #1

Open
michael-go wants to merge 1 commit into
gdb:masterfrom
michael-go:server/unset-listen-backlog
Open

avoid setting socket listen backlog to 1, handle more concurrent conns#1
michael-go wants to merge 1 commit into
gdb:masterfrom
michael-go:server/unset-listen-backlog

Conversation

@michael-go

Copy link
Copy Markdown

On MacOS, with listen(1), when starting more than ~3 concurrent clients, new clients often get ECONNREFUSED as it can take few ms for the server to accept() each connection. By not setting the backlog in listen(), it seems to handle even 1000 concurrent connections just fine.
Tested also on Linux, where it behaves the same with and without the param.

On MacOS, with listen(1), when starting more than ~3 concurrent clients,
new clients often get ECONNREFUSED as it can take few ms for the server
to accept() each connection. By not setting the backlog in listen(),
it seems to handle even 1000 concurrent connections just fine.
Tested also on Linux, where it behaves the same with and without the
param.
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.

1 participant