rsked/playermgr.cc
/// Invoked periodically to check if any players are in the wrong
/// state.  The check() method of the player is responsible for taking
/// any corrective action as appropriate. Typically, a player may be
/// restarted (up to a certain number of times) on a given source
/// before that source is marked as "failed" (making it taboo for a while).
/// In some cases the player itself may be marked as defective.
///
/// Typically called for side effects, but returns true iff all
/// players check out okay.
///
Invoked periodically to check if any players are in the wrong
state.  The check() method of the player is responsible for taking
any corrective action as appropriate. Typically, a player may be
restarted (up to a certain number of times) on a given source
before that source is marked as "failed" (making it taboo for a while).
In some cases the player itself may be marked as defective.

Typically called for side effects, but returns true iff all
players check out okay.
Invoked periodically to check if any players are in the wrong state . The check () method of the player is responsible for taking any corrective action as appropriate . Typically a player may be restarted ( up to a certain number of times ) on a given source before that source is marked as " failed " ( making it taboo for a while ) . In some cases the player itself may be marked as defective . Typically called for side effects but returns true iff all players check out okay .
bool Player_manager::check_players()
{
    check_inet(); 
    unsigned nc=0, ngood=0, nplaying=0;
    for ( auto pair : m_players ) {
        spPlayer sp = pair.second;
        if (sp) {
            nc++;
            if (sp->check()) {
                ngood++;
            } else {
                if (sp->is_enabled()) {
                    LOG_DEBUG(Lgr) << "Player_manager: check fails for "
                                   << pair.first;
                }
            }
            if (sp->state() ==  PlayerState::Playing) {
                nplaying++;
            }
        }
    }
    LOG_DEBUG(Lgr) << "Player_manager: " << ngood << "/" << nc
                   << " players okay, " << nplaying << " playing";
    if (nplaying > 1) {          this really shouldn't happen...
        return fix_contention( nplaying );
    }
    return (nc == ngood);
}
bool Player_manager :: check_players ( ) { check_inet ( ) ; unsigned nc = 0 , ngood = 0 , nplaying = 0 ; for ( auto pair : m_players ) { spPlayer sp = pair . second ; if ( sp ) { nc ++ ; if ( sp -> check ( ) ) { ngood ++ ; } else { if ( sp -> is_enabled ( ) ) { LOG_DEBUG ( Lgr ) << " " << pair . first ; } } if ( sp -> state ( ) == PlayerState :: Playing ) { nplaying ++ ; } } } LOG_DEBUG ( Lgr ) << " " << ngood << " " << nc << " " << nplaying << " " ; if ( nplaying > 1 ) { return fix_contention ( nplaying ) ; } return ( nc == ngood ) ; }
Invoked periodically to check if any players are in the wrong
state.
Invoked periodically to check if any players are in the wrong state .
// players may invoke Player_manager::inet_available() // // this really shouldn't happen...