2023-01-05 14:41:03 +00:00
|
|
|
// Copyright (C) 2023 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
|
|
|
"syscall"
|
|
|
|
|
|
|
|
"go.uber.org/zap"
|
|
|
|
)
|
|
|
|
|
2023-01-31 13:59:04 +00:00
|
|
|
const tcpFastOpenServer = 15
|
2023-01-05 14:41:03 +00:00
|
|
|
|
|
|
|
func setTCPFastOpen(fd uintptr, queue int) error {
|
2023-01-31 13:59:04 +00:00
|
|
|
return syscall.SetsockoptInt(syscall.Handle(fd), syscall.IPPROTO_TCP, tcpFastOpenServer, 1)
|
2023-01-05 14:41:03 +00:00
|
|
|
}
|
|
|
|
|
2023-01-31 14:00:44 +00:00
|
|
|
func tryInitFastOpen(*zap.Logger) {
|
|
|
|
// should we log or check something along the lines of
|
|
|
|
// netsh int tcp set global fastopen=enabled
|
|
|
|
// netsh int tcp set global fastopenfallback=disabled
|
|
|
|
// ?
|
|
|
|
}
|