diff options
author | Guido van Rossum <guido@dropbox.com> | 2013-10-18 14:50:45 -0700 |
---|---|---|
committer | Guido van Rossum <guido@dropbox.com> | 2013-10-18 14:50:45 -0700 |
commit | a9185a95a92ea7d3ed377bf60baaf56be461155f (patch) | |
tree | 0e72756a21408e3a65c36fb3ea6964e381b79e8a /examples | |
parent | d31da54fc651e056beb3c9b32c10c0318485fee3 (diff) | |
download | trollius-a9185a95a92ea7d3ed377bf60baaf56be461155f.tar.gz |
Fix example to use create_server() instead of start_serving().
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/tcp_echo.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/tcp_echo.py b/examples/tcp_echo.py index 39db5cc..9ecc480 100755 --- a/examples/tcp_echo.py +++ b/examples/tcp_echo.py @@ -70,9 +70,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] - print('serving on', x.getsockname()) + f = loop.create_server(EchoServer, host, port) + s = loop.run_until_complete(f) + print('serving on', s.sockets[0].getsockname()) ARGS = argparse.ArgumentParser(description="TCP Echo example.") |