github.com/database64128/tfo-go/v2@v2.2.0/sockopt_darwin.go (about) 1 package tfo 2 3 import "golang.org/x/sys/unix" 4 5 const TCP_FASTOPEN_FORCE_ENABLE = 0x218 6 7 // setTFOForceEnable disables the Darwin kernel's brutal TFO backoff mechanism. 8 func setTFOForceEnable(fd uintptr) error { 9 return unix.SetsockoptInt(int(fd), unix.IPPROTO_TCP, TCP_FASTOPEN_FORCE_ENABLE, 1) 10 } 11 12 func setTFODialer(fd uintptr) error { 13 return setTFOForceEnable(fd) 14 }