code: func TryConnectEndpoints(service proxy.ServicePortName, srcAddr net.Addr, protocol string, loadBalancer LoadBalancer) (out net.Conn, err error) {
  	sessionAffinityReset := false
  	for _, dialTimeout := range EndpointDialTimeouts {
  		endpoint, err := loadBalancer.NextEndpoint(service, srcAddr, sessionAffinityReset)
  		if err != nil {
  			klog.Errorf("Couldn't find an endpoint for %s: %v", service, err)
  			return nil, err
  		}
  		klog.V(3).Infof("Mapped service %q to endpoint %s", service, endpoint)
  		// TODO: This could spin up a new goroutine to make the outbound connection,
  		// and keep accepting inbound traffic.
  		outConn, err := net.DialTimeout(protocol, endpoint, dialTimeout)
  		if err != nil {
  			if isTooManyFDsError(err) {
  				panic("Dial failed: " + err.Error())
  			}
  			klog.Errorf("Dial failed: %v", err)
  			sessionAffinityReset = true
  			continue
  		}
  		return outConn, nil
  	}
  	return nil, fmt.Errorf("failed to connect to an endpoint.")
  }
docs: // TryConnectEndpoints attempts to connect to the next available endpoint for the given service, cycling
  // through until it is able to successfully connect, or it has tried with all timeouts in EndpointDialTimeouts.