storj/private/server/fastopen_windows.go
JT Olio 1966340b2a storagenode: report fastopen support
Change-Id: Ic707bce32729540391d5139e7f3a82c693bcb834
2023-06-05 15:20:13 +00:00

26 lines
609 B
Go

// Copyright (C) 2023 Storj Labs, Inc.
// See LICENSE for copying information.
package server
import (
"syscall"
"go.uber.org/zap"
)
const tcpFastOpenServer = 15
func setTCPFastOpen(fd uintptr, queue int) error {
return syscall.SetsockoptInt(syscall.Handle(fd), syscall.IPPROTO_TCP, tcpFastOpenServer, 1)
}
// tryInitFastOpen returns true if fastopen support is possibly enabled.
func tryInitFastOpen(*zap.Logger) bool {
// should we log or check something along the lines of
// netsh int tcp set global fastopen=enabled
// netsh int tcp set global fastopenfallback=disabled
// ?
return false
}