diff --git a/remote-host.go b/remote-host.go index 88e2837..5bb33c4 100644 --- a/remote-host.go +++ b/remote-host.go @@ -43,7 +43,9 @@ func (h *RemoteHost) Ping() error { if err != nil { h.MissedPings++ log.Printf("Error pinging remote %s, missed pings: %d", h.Host, h.MissedPings) - + if h.MissedPings >= 3 { + h.Close() + } } else { h.MissedPings = 0 }