How should I determine what to use for a listening socket's backlog parameter? Is it a problem to simply specify a very large number?
相关问题
- Sorting 3 numbers without branching [closed]
- Multiple sockets for clients to connect to
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
相关文章
- Socket编程 TCP方式发送时间有点长
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
From the docs:
As a warning to anyone using boost asio, the SOMAXCONN value is used as 5 with boost.
There's a very long answer to this in the Winsock Programmer's FAQ. It details the standard setting, and the dynamic backlog feature added in a hotfix to NT 4.0.
I second using SOMAXCONN, unless you have a specific reason to use a short queue.
Keep in mind that if there is no room in the queue for a new connection, no RST will be sent, allowing the client to automatically continue trying to connect by retransmitting SYN.
Also, the backlog argument can have different meanings in different socket implementations.