@asyncio.coroutine<EOL><INDENT>def _select_next_server(self):<DEDENT>
while True:<EOL><INDENT>if len(self._server_pool) == <NUM_LIT:0>:<EOL><INDENT>self._current_server = None<EOL>raise ErrNoServers<EOL><DEDENT>now = time.monotonic()<EOL>s = self._server_pool.pop(<NUM_LIT:0>)<EOL>if self.options["<STR_LIT>"] > <NUM_LIT:0>:<EOL><INDENT>if s.reconnects > self.options["<STR_LIT>"]:<EOL><INDENT>continue<EOL><DEDENT><DEDENT>self._server_pool.append(s)<EOL>if s.last_attempt is not None and now < s.last_attempt + self.options["<STR_LIT>"]:<EOL><INDENT>yield from asyncio.sleep(self.options["<STR_LIT>"], loop=self._loop)<EOL><DEDENT>try:<EOL><INDENT>s.last_attempt = time.monotonic()<EOL>r, w = yield from asyncio.open_connection(<EOL>s.uri.hostname,<EOL>s.uri.port,<EOL>loop=self._loop,<EOL>limit=DEFAULT_BUFFER_SIZE)<EOL>self._current_server = s<EOL>self._bare_io_reader = self._io_reader = r<EOL>self._bare_io_writer = self._io_writer = w<EOL>break<EOL><DEDENT>except Exception as e:<EOL><INDENT>s.last_attempt = time.monotonic()<EOL>s.reconnects += <NUM_LIT:1><EOL>self._err = e<EOL>if self._error_cb is not None:<EOL><INDENT>yield from self._error_cb(e)<EOL><DEDENT>continue<EOL><DEDENT><DEDENT>
Looks up in the server pool for an available server
and attempts to connect.