mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2025-02-24 05:02:14 +08:00
13 lines
199 B
Go
13 lines
199 B
Go
|
//go:build !go1.23
|
||
|
|
||
|
package net
|
||
|
|
||
|
import "net"
|
||
|
|
||
|
func TCPKeepAlive(c net.Conn) {
|
||
|
if tcp, ok := c.(*net.TCPConn); ok {
|
||
|
_ = tcp.SetKeepAlive(true)
|
||
|
_ = tcp.SetKeepAlivePeriod(KeepAliveInterval)
|
||
|
}
|
||
|
}
|