getRecommendedServers

suspend fun getRecommendedServers(servers: Collection<String>, minimumScore: RecommendedServerInfoScore = RecommendedServerInfoScore.BAD): Collection<RecommendedServerInfo>

Connects to the servers and returns a flow of scored servers in the same order as the input. Uses the RecommendedServerDiscovery rules to determine the recommendation.

If the input in servers is the output from getAddressCandidates the optimal server to use will be the first returned server with a RecommendedServerInfoScore.GREAT score. If no server with RecommendedServerInfoScore.GREAT is returned the best option is the first server with a RecommendedServerInfoScore.GOOD score. The RecommendedServerInfoScore.OK and RecommendedServerInfoScore.BAD scored are not recommended for connection.

Output is not sorted, a BAD match could be returned before a GOOD match. Never just use the first result.


suspend fun getRecommendedServers(input: String, minimumScore: RecommendedServerInfoScore = RecommendedServerInfoScore.BAD): Collection<RecommendedServerInfo>

Utility function that calls getRecommendedServers with the output of getAddressCandidates.