Skip to content

Commit

Permalink
Use create_server for tcp protocol example.
Browse files Browse the repository at this point in the history
  • Loading branch information
oohlaf committed Oct 13, 2013
1 parent 30a3e93 commit bd4d2f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/tcp_protocol_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit bd4d2f4

Please sign in to comment.