code: func (s *remoteSite) nextConn() (*remoteConn, error) {
  	s.Lock()
  	defer s.Unlock()
  
  	s.removeInvalidConns()
  
  	for i := 0; i < len(s.connections); i++ {
  		s.lastUsed = (s.lastUsed + 1) % len(s.connections)
  		remoteConn := s.connections[s.lastUsed]
  		// connection could have been initated, but agent
  		// on the other side is not ready yet.
  		// Proxy assumes that connection is ready to serve when
  		// it has received a first heartbeat, otherwise
  		// it could attempt to use it before the agent
  		// had a chance to start handling connection requests,
  		// what could lead to proxy marking the connection
  		// as invalid without a good reason.
  		if remoteConn.isReady() {
  			return remoteConn, nil
  		}
  	}
  
  	return nil, trace.NotFound("%v is offline: no active tunnels to %v found", s.GetName(), s.srv.ClusterName)
  }
docs: // nextConn returns next connection that is ready
  // and has not been marked as invalid
  // it will close connections marked as invalid