tun2: loop forever at the foot of HandleConn

This commit is contained in:
Cadey Ratio 2017-04-05 14:48:08 -07:00
parent 1827d19e84
commit 56fc4f89ba
1 changed files with 44 additions and 42 deletions

View File

@ -361,6 +361,7 @@ func (s *Server) HandleConn(c net.Conn, isKCP bool) {
ticker := time.NewTicker(5 * time.Second) ticker := time.NewTicker(5 * time.Second)
defer ticker.Stop() defer ticker.Stop()
for {
select { select {
case <-ticker.C: case <-ticker.C:
err := connection.Ping() err := connection.Ping()
@ -409,6 +410,7 @@ func (s *Server) HandleConn(c net.Conn, isKCP bool) {
return return
} }
} }
}
func (s *Server) RoundTrip(req *http.Request) (*http.Response, error) { func (s *Server) RoundTrip(req *http.Request) (*http.Response, error) {
var conns []*Connection var conns []*Connection