@call_async<EOL><INDENT>def create_connection(self, room, ws_url, agent, cookies):<DEDENT>
urlparts = urlsplit(ws_url)<EOL>req = Request("<STR_LIT:GET>", ws_url)<EOL>cookies = get_cookie_header(cookies, req)<EOL>if cookies:<EOL><INDENT>headers = dict(Cookie=cookies)<EOL><DEDENT>else:<EOL><INDENT>headers = None<EOL><DEDENT>factory = WebSocketClientFactory(ws_url, headers=headers, loop=self.loop)<EOL>factory.useragent = agent<EOL>factory.protocol = lambda: room<EOL>conn = self.loop.create_connection(<EOL>factory,<EOL>host=urlparts.netloc,<EOL>port=urlparts.port or <NUM_LIT>,<EOL>ssl=urlparts.scheme == "<STR_LIT>",<EOL>)<EOL>asyncio.ensure_future(conn, loop=self.loop)<EOL>
Creates a new connection