2018-02-23 09:53:12 +01:00
|
|
|
Copyright (C) 2016-2018 Internet Systems Consortium, Inc. ("ISC")
|
2016-08-12 15:31:33 +10:00
|
|
|
|
|
|
|
This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
2018-02-23 09:53:12 +01:00
|
|
|
See the COPYRIGHT file distributed with this work for additional
|
|
|
|
information regarding copyright ownership.
|
|
|
|
|
2016-08-12 15:31:33 +10:00
|
|
|
Some systems (Linux, FreeBSD, OS X/macOS and Windows 10) support
|
|
|
|
the TCP Fast Open (RFC 7413) mechanism in their recent versions.
|
|
|
|
|
|
|
|
BIND 9 supports this on the server side.
|
|
|
|
|
|
|
|
When the TCP_FASTOPEN socket option is defined after the listen()
|
|
|
|
system call the socket code in the libisc set the option with
|
|
|
|
the half of the listen backlog (so the fast open maximum queue length
|
|
|
|
is the half of the pending connection queue length).
|
|
|
|
Any failure is logged and ignored.
|
|
|
|
|
|
|
|
System specific notes:
|
|
|
|
- FreeBSD doesn't interpret the argument as a queue length but
|
|
|
|
only as an on/off switch.
|
|
|
|
|
2017-09-18 08:34:41 +02:00
|
|
|
- Using TCP Fast Open on FreeBSD, as of versions 10.3 and 11.0, requires
|
|
|
|
compiling a custom kernel and setting the "net.inet.tcp.fastopen.enabled"
|
|
|
|
sysctl to 1.
|
|
|
|
|
2016-08-12 15:31:33 +10:00
|
|
|
- Apple OS X/macOS allows only 0 or 1 so the code puts 1 for this system.
|
|
|
|
|
2016-08-15 19:43:20 +02:00
|
|
|
- Windows 10 uses a 0/1 char flag? Note that TCP_FASTOPEN is defined
|
|
|
|
only in SDK 10.0.14393.0 or higher (Visual Studio 2015 requires
|
|
|
|
extra setting of the "Target Platform Version" in all project
|
|
|
|
properties).
|
2016-08-12 15:31:33 +10:00
|
|
|
|
|
|
|
- the only other system known to support this is Linux.
|
|
|
|
|