From bd4d2f48fdb11ca15dad4675d8b05c61ae0e5361 Mon Sep 17 00:00:00 2001 From: Olaf Conradi Date: Sun, 13 Oct 2013 22:42:40 +0200 Subject: [PATCH] Use create_server for tcp protocol example. --- examples/tcp_protocol_parser.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/tcp_protocol_parser.py b/examples/tcp_protocol_parser.py index a4b92d2dc70..665699a1d2a 100755 --- a/examples/tcp_protocol_parser.py +++ b/examples/tcp_protocol_parser.py @@ -133,8 +133,9 @@ def start_client(loop, host, port): def start_server(loop, host, port): - f = loop.start_serving(EchoServer, host, port) - x = loop.run_until_complete(f)[0] + f = loop.create_server(EchoServer, host, port) + srv = loop.run_until_complete(f) + x = srv.sockets[0] print('serving on', x.getsockname()) loop.run_forever()