def coro(): try: yield from server.start(None, 8888) yield from client.connect("127.0.0.1", 8888) yield from client.login() finally: server.close() yield from server.wait_closed()
def coro(): try: yield from server.start(None, 8888) yield from client.connect("127.0.0.1", 8888) yield from asyncio.sleep(10, loop=loop) finally: server.close() yield from server.wait_closed()