2020-03-21 23:46:49 +08:00
|
|
|
package outboundgroup
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
func tcpKeepAlive(c net.Conn) {
|
|
|
|
if tcp, ok := c.(*net.TCPConn); ok {
|
2022-04-20 01:52:51 +08:00
|
|
|
_ = tcp.SetKeepAlive(true)
|
|
|
|
_ = tcp.SetKeepAlivePeriod(30 * time.Second)
|
2020-03-21 23:46:49 +08:00
|
|
|
}
|
|
|
|
}
|
2022-05-23 00:40:27 +08:00
|
|
|
|
|
|
|
type SelectAble interface {
|
|
|
|
Set(string) error
|
2023-04-24 08:07:17 +08:00
|
|
|
ForceSet(name string)
|
2022-05-23 00:40:27 +08:00
|
|
|
}
|