Skip to content

Commit

Permalink
Stop listening when HttpServer is stopped
Browse files Browse the repository at this point in the history
  • Loading branch information
Elmo Todurov committed Sep 26, 2013
1 parent 4b18a67 commit a774cc1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spinoff/contrib/http/server.py
Expand Up @@ -18,6 +18,9 @@ def pre_start(self, address, responders, default_content_type='text/html'):
self.server = WSGIServer(address, self.handle_wsgi_request)
self.server.start()

def post_stop(self):
self.server.stop()

def handle_wsgi_request(self, env, start_response):
ch = Channel()
req = Request(ch, env, start_response, default_content_type=self.default_content_type)
Expand Down

0 comments on commit a774cc1

Please sign in to comment.