Feature #1447
closedTCP_DEFER_ACCEPT
Description
Hi,
On Linux, TCP_DEFER_ACCEPT can be enabled to defer accept calls until there is (also) data ready to be read.
On FreeBSD, SO_ACCEPTFILTER can be enabled to defer accept calls until there is a complete HTTP request (or something else) to be read.
#ifdef SO_ACCEPTFILTER accept_filter_arg afa; bzero(&afa, sizeof(afa)); strcpy(afa.af_name, "httpready"); l.setsockopt(SOL_SOCKET, SO_ACCEPTFILTER, &afa, sizeof(afa)); #elif TCP_DEFER_ACCEPT int v = true; setsockopt(acceptor_.native(), IPPROTO_TCP, TCP_DEFER_ACCEPT, &v, sizeof(v)); #endif
Updated by Olaf-van-der-Spek almost 16 years ago
- Target version changed from 1.5.0 to 1.4.21
Updated by icy almost 16 years ago
- Target version changed from 1.4.21 to 1.4.22
- Patch available set to No
Updated by stbuehler over 15 years ago
- Target version changed from 1.4.22 to 1.4.23
Updated by stbuehler over 15 years ago
TCP_DEFER_ACCEPT:
Allows a listener to be awakened only when data arrives on the socket. Takes an integer value (seconds), this can bound the maximum number of attempts TCP will make to complete the connection.
I don't think "TRUE" is a good value here.
Updated by Olaf-van-der-Spek over 15 years ago
You're right, haven't seen that part before. I'm still not sure what exactly that parameter does though.
Updated by stbuehler over 15 years ago
linux kernel sources (net/ipv4/tcp.c), search for TCP_DEFER_ACCEPT:
Translate value in seconds to number of retransmits
I have no idea what that means... :)
0 means disable, so i will make the option a "unsigned short" in the config, and it will be only set if it is != 0.
SO_ACCEPTFILTER is already in the source and enabled by default.
Updated by stbuehler over 15 years ago
- Status changed from New to Fixed
- % Done changed from 0 to 100
Applied in changeset r2479.
Also available in: Atom