tcp长连接设置保持连接活跃 func (c *TCPConn) SetKeepAlive(keepalive bool) error SetKeepAlive sets whether the operating system should send keepalive messages on the connection. func (c *TCPConn) SetKeepAlivePeriod(d time.Duration) error SetKeepAlivePeriod sets period between keep alives. 参见golang官网:https://golang.org/pkg/net/#TCPConn.SetKeepAlive