def select_server_by_address(self, address,
server_selection_timeout=None):
"""Return a Server for "address", reconnecting if necessary.
If the server's type is not known, request an immediate check of all
servers. Time out after "server_selection_timeout" if the server
cannot be reached.
:Parameters:
- `address`: A (host, port) pair.
- `server_selection_timeout` (optional): maximum seconds to wait.
If not provided, the default value
common.SERVER_SELECTION_TIMEOUT is used.
Calls self.open() if needed.
Raises exc:`ServerSelectionTimeoutError` after
`server_selection_timeout` if no matching servers are found.
"""
return self.select_server(any_server_selector,
server_selection_timeout,
address)
评论列表
文章目录