Support TCP fastopen on incoming and outgoing connections.

This commit is contained in:
Simon Kelley
2019-03-10 22:44:15 +00:00
parent c61c7bb225
commit 608aa9fcfc
4 changed files with 51 additions and 10 deletions

View File

@@ -726,6 +726,11 @@ static int make_sock(union mysockaddr *addr, int type, int dienow)
if (type == SOCK_STREAM)
{
#ifdef TCP_FASTOPEN
int qlen = 5;
setsockopt(fd, SOL_TCP, TCP_FASTOPEN, &qlen, sizeof(qlen));
#endif
if (listen(fd, TCP_BACKLOG) == -1)
goto err;
}