github.com/metacubex/tfo-go@v0.0.0-20240228025757-be1269474a66/sockopt_generic.go (about)

     1  //go:build darwin || freebsd || linux
     2  
     3  package tfo
     4  
     5  import "golang.org/x/sys/unix"
     6  
     7  func setTFO(fd, value int) error {
     8  	return unix.SetsockoptInt(fd, unix.IPPROTO_TCP, unix.TCP_FASTOPEN, value)
     9  }