mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-12-19 16:30:07 +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)
|
|
}
|
|
}
|