code: function selectServers(topology, selector, timeout, start, callback) {
    const serverDescriptions = Array.from(topology.description.servers.values());
    let descriptions;
  
    try {
      descriptions = selector
        ? selector(topology.description, serverDescriptions)
        : serverDescriptions;
    } catch (e) {
      return callback(e, null);
    }
  
    if (descriptions.length) {
      const servers = descriptions.map(description => topology.s.servers.get(description.address));
      return callback(null, servers);
    }
  
    const duration = calculateDurationInMs(start);
    if (duration >= timeout) {
      return callback(new MongoTimeoutError(`Server selection timed out after ${timeout} ms`));
    }
  
    const retrySelection = () => {
      // ensure all server monitors attempt monitoring immediately
      topology.s.servers.forEach(server => server.monitor());
  
      const iterationTimer = setTimeout(() => {
        callback(new MongoTimeoutError('Server selection timed out due to monitoring'));
      }, topology.s.minHeartbeatIntervalMS);
  
      topology.once('topologyDescriptionChanged', () => {
        // successful iteration, clear the check timer
        clearTimeout(iterationTimer);
  
        // topology description has changed due to monitoring, reattempt server selection
        selectServers(topology, selector, timeout, start, callback);
      });
    };
  
    // ensure we are connected
    if (!topology.s.connected) {
      topology.connect();
  
      // we want to make sure we're still within the requested timeout window
      const failToConnectTimer = setTimeout(() => {
        callback(new MongoTimeoutError('Server selection timed out waiting to connect'));
      }, timeout - duration);
  
      topology.once('connect', () => {
        clearTimeout(failToConnectTimer);
        retrySelection();
      });
  
      return;
    }
  
    retrySelection();
  }
docs: Selects servers using the provided selector
  
  @private
  @param {Topology} topology The topology to select servers from
  @param {function} selector The actual predicate used for selecting servers
  @param {Number} timeout The max time we are willing wait for selection
  @param {Number} start A high precision timestamp for the start of the selection process
  @param {function} callback The callback used to convey errors or the resultant servers