@asyncio.coroutine<EOL><INDENT>def _process_connect_init(self):<DEDENT>
self._status = Client.CONNECTING<EOL>connection_completed = self._io_reader.readline()<EOL>info_line = yield from asyncio.wait_for(connection_completed, self.options["<STR_LIT>"])<EOL>if INFO_OP not in info_line:<EOL><INDENT>raise NatsError("<STR_LIT>")<EOL><DEDENT>_, info = info_line.split(INFO_OP + _SPC_, <NUM_LIT:1>)<EOL>try:<EOL><INDENT>srv_info = json.loads(info.decode())<EOL><DEDENT>except:<EOL><INDENT>raise NatsError("<STR_LIT>")<EOL><DEDENT>self._process_info(srv_info)<EOL>self._server_info = srv_info<EOL>if '<STR_LIT>' in self._server_info:<EOL><INDENT>self._max_payload = self._server_info["<STR_LIT>"]<EOL><DEDENT>if '<STR_LIT>' in self._server_info and self._server_info['<STR_LIT>']:<EOL><INDENT>ssl_context = None<EOL>if "<STR_LIT>" in self.options:<EOL><INDENT>ssl_context = self.options.get('<STR_LIT>')<EOL><DEDENT>elif self._current_server.uri.scheme == '<STR_LIT>':<EOL><INDENT>ssl_context = ssl.create_default_context()<EOL><DEDENT>else:<EOL><INDENT>raise NatsError('<STR_LIT>')<EOL><DEDENT>transport = self._io_writer.transport<EOL>sock = transport.get_extra_info('<STR_LIT>')<EOL>if not sock:<EOL><INDENT>raise NatsError('<STR_LIT>')<EOL><DEDENT>yield from self._io_writer.drain()  <EOL>self._io_reader, self._io_writer =yield from asyncio.open_connection(<EOL>loop=self._loop,<EOL>limit=DEFAULT_BUFFER_SIZE,<EOL>sock=sock,<EOL>ssl=ssl_context,<EOL>server_hostname=self._current_server.uri.hostname,<EOL>)<EOL><DEDENT>if self.is_reconnecting:<EOL><INDENT>self._ps.reset()<EOL><DEDENT>connect_cmd = self._connect_command()<EOL>self._io_writer.write(connect_cmd)<EOL>self._io_writer.write(PING_PROTO)<EOL>yield from self._io_writer.drain()<EOL>next_op = yield from self._io_reader.readline()<EOL>if self.options["<STR_LIT>"] and OK_OP in next_op:<EOL><INDENT>next_op = yield from self._io_reader.readline()<EOL><DEDENT>if ERR_OP in next_op:<EOL><INDENT>err_line = next_op.decode()<EOL>_, err_msg = err_line.split("<STR_LIT:U+0020>", <NUM_LIT:1>)<EOL>raise NatsError("<STR_LIT>" + err_msg.rstrip('<STR_LIT:\r\n>'))<EOL><DEDENT>if PONG_PROTO in next_op:<EOL><INDENT>self._status = Client.CONNECTED<EOL><DEDENT>self._reading_task = self._loop.create_task(self._read_loop())<EOL>self._pongs = []<EOL>self._pings_outstanding = <NUM_LIT:0><EOL>self._ping_interval_task = self._loop.create_task(<EOL>self._ping_interval())<EOL>self._flusher_task = self._loop.create_task(self._flusher())<EOL>
Process INFO received from the server and CONNECT to the server
with authentication.  It is also responsible of setting up the
reading and ping interval tasks from the client.