clash/adapter/outboundgroup/util.go

19 lines
274 B
Go
Raw Normal View History

package outboundgroup
import (
"net"
"time"
)
func tcpKeepAlive(c net.Conn) {
if tcp, ok := c.(*net.TCPConn); ok {
2022-04-19 17:52:51 +00:00
_ = tcp.SetKeepAlive(true)
_ = tcp.SetKeepAlivePeriod(30 * time.Second)
}
}
2022-05-22 16:40:27 +00:00
type SelectAble interface {
Set(string) error
ForceSet(name string)
2022-05-22 16:40:27 +00:00
}