Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
05227912
Unverified
Commit
05227912
authored
Aug 27, 2018
by
Ge Jun
Committed by
GitHub
Aug 27, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #466 from gydong/master
change the backlog of listen() from INT_MAX to 65535
parents
0b4117d8
fbeffa45
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
endpoint.cpp
src/butil/endpoint.cpp
+3
-2
No files found.
src/butil/endpoint.cpp
View file @
05227912
...
@@ -337,9 +337,10 @@ int tcp_listen(EndPoint point, bool reuse_addr) {
...
@@ -337,9 +337,10 @@ int tcp_listen(EndPoint point, bool reuse_addr) {
if
(
bind
(
sockfd
,
(
struct
sockaddr
*
)
&
serv_addr
,
sizeof
(
serv_addr
))
!=
0
)
{
if
(
bind
(
sockfd
,
(
struct
sockaddr
*
)
&
serv_addr
,
sizeof
(
serv_addr
))
!=
0
)
{
return
-
1
;
return
-
1
;
}
}
if
(
listen
(
sockfd
,
INT_MAX
)
!=
0
)
{
if
(
listen
(
sockfd
,
65535
)
!=
0
)
{
// ^^^ kernel would silently truncate backlog to the value
// ^^^ kernel would silently truncate backlog to the value
// defined in /proc/sys/net/core/somaxconn
// defined in /proc/sys/net/core/somaxconn if it is less
// than 65535
return
-
1
;
return
-
1
;
}
}
return
sockfd
.
release
();
return
sockfd
.
release
();
...
...
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