From 929a5d5d42ce100d62e98e0f98ba266c6ea19954 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Mon, 10 Sep 2018 20:06:58 +0200 Subject: [PATCH] fix sockopt for windows --- transport/internet/sockopt_windows.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/transport/internet/sockopt_windows.go b/transport/internet/sockopt_windows.go index 58a1c572..dc22eff3 100644 --- a/transport/internet/sockopt_windows.go +++ b/transport/internet/sockopt_windows.go @@ -13,11 +13,11 @@ func applyOutboundSocketOptions(network string, address string, fd uintptr, conf if strings.HasPrefix(network, "tcp") { switch config.Tfo { case SocketConfig_Enable: - if err := syscall.SetsockoptInt(int(fd), syscall.IPPROTO_TCP, TCP_FASTOPEN, 1); err != nil { + if err := syscall.SetsockoptInt(syscall.Handle(fd), syscall.IPPROTO_TCP, TCP_FASTOPEN, 1); err != nil { return err } case SocketConfig_Disable: - if err := syscall.SetsockoptInt(int(fd), syscall.IPPROTO_TCP, TCP_FASTOPEN, 0); err != nil { + if err := syscall.SetsockoptInt(syscall.Handle(fd), syscall.IPPROTO_TCP, TCP_FASTOPEN, 0); err != nil { return err } } @@ -30,11 +30,11 @@ func applyInboundSocketOptions(network string, fd uintptr, config *SocketConfig) if strings.HasPrefix(network, "tcp") { switch config.Tfo { case SocketConfig_Enable: - if err := syscall.SetsockoptInt(int(fd), syscall.IPPROTO_TCP, TCP_FASTOPEN, 1); err != nil { + if err := syscall.SetsockoptInt(syscall.Handle(fd), syscall.IPPROTO_TCP, TCP_FASTOPEN, 1); err != nil { return err } case SocketConfig_Disable: - if err := syscall.SetsockoptInt(int(fd), syscall.IPPROTO_TCP, TCP_FASTOPEN, 0); err != nil { + if err := syscall.SetsockoptInt(syscall.Handle(fd), syscall.IPPROTO_TCP, TCP_FASTOPEN, 0); err != nil { return err } }