Skip to content

Commit

Permalink
embed macOS const to avoid platform inconsistency(again)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaokangwang committed Apr 28, 2022
1 parent ea752ed commit c9e65b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion transport/internet/sockopt_darwin.go
Expand Up @@ -28,7 +28,7 @@ func applyOutboundSocketOptions(network string, address string, fd uintptr, conf
}

if config.TcpKeepAliveInterval > 0 {
if err := syscall.SetsockoptInt(int(fd), syscall.IPPROTO_TCP, syscall.TCP_KEEPINTVL, int(config.TcpKeepAliveInterval)); err != nil {
if err := syscall.SetsockoptInt(int(fd), syscall.IPPROTO_TCP, TCP_KEEPINTVL, int(config.TcpKeepAliveInterval)); err != nil {
return newError("failed to set TCP_KEEPINTVL", err)
}
if err := syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, syscall.SO_KEEPALIVE, 1); err != nil {
Expand Down

0 comments on commit c9e65b9

Please sign in to comment.