func indirectPing()

in swim/ping_request_sender.go [120:138]


func indirectPing(n *Node, target string, amount int, timeout time.Duration) (reached bool, errs []error) {
	resCh := sendPingRequests(n, target, amount, timeout)

	// wait for responses from the ping-reqs
	for result := range resCh {
		switch res := result.(type) {
		case *pingResponse:
			if res.Ok {
				return true, errs
			}
			// If the ping to the target was not-ok we want to wait for more results.

		case error:
			errs = append(errs, res)
		}
	}

	return false, errs
}