Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API changed to create_server #1

Merged
merged 2 commits into from
Oct 13, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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