Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
0d83011a
Commit
0d83011a
authored
Apr 11, 2012
by
Salvatore Sanfilippo
Browse files
Merge pull request #449 from ErikDubbelboer/unstable
added explanation for the magic 511 backlog number
parents
ced06895
815c06f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/anet.c
View file @
0d83011a
...
...
@@ -262,7 +262,11 @@ static int anetListen(char *err, int s, struct sockaddr *sa, socklen_t len) {
close
(
s
);
return
ANET_ERR
;
}
if
(
listen
(
s
,
511
)
==
-
1
)
{
/* the magic 511 constant is from nginx */
/* Use a backlog of 512 entries. We pass 511 to the listen() call because
* the kernel does: backlogsize = roundup_pow_of_two(backlogsize + 1);
* which will thus give us a backlog of 512 entries */
if
(
listen
(
s
,
511
)
==
-
1
)
{
anetSetError
(
err
,
"listen: %s"
,
strerror
(
errno
));
close
(
s
);
return
ANET_ERR
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment