Skip to content

Commit

Permalink
API changed to create_server
Browse files Browse the repository at this point in the history
  • Loading branch information
oohlaf committed Oct 13, 2013
1 parent 2fb6a3b commit 30a3e93
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions examples/mpsrv.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,10 @@ def stop():
os._exit(0)
loop.add_signal_handler(signal.SIGINT, stop)

f = loop.start_serving(
f = loop.create_server(
lambda: HttpServer(debug=True, keep_alive=75), sock=self.sock)
x = loop.run_until_complete(f)[0]
srv = loop.run_until_complete(f)
x = srv.sockets[0]
print('Starting srv worker process {} on {}'.format(
os.getpid(), x.getsockname()))

Expand Down
5 changes: 3 additions & 2 deletions examples/srv.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,11 @@ def main():
sslcontext = None

loop = tulip.get_event_loop()
f = loop.start_serving(
f = loop.create_server(
lambda: HttpServer(debug=True, keep_alive=75), args.host, args.port,
ssl=sslcontext)
socks = loop.run_until_complete(f)
svr = loop.run_until_complete(f)
socks = svr.sockets
print('serving on', socks[0].getsockname())
try:
loop.run_forever()
Expand Down

0 comments on commit 30a3e93

Please sign in to comment.