diff --git a/daphne/server.py b/daphne/server.py index 0e2d432..7615959 100755 --- a/daphne/server.py +++ b/daphne/server.py @@ -6,16 +6,17 @@ from .http_protocol import HTTPFactory class Server(object): - def __init__(self, channel_layer, host="127.0.0.1", port=8000): + def __init__(self, channel_layer, host="127.0.0.1", port=8000, signal_handlers=True): self.channel_layer = channel_layer self.host = host self.port = port + self.signal_handlers = signal_handlers def run(self): self.factory = HTTPFactory(self.channel_layer) reactor.listenTCP(self.port, self.factory, interface=self.host) reactor.callInThread(self.backend_reader) - reactor.run() + reactor.run(installSignalHandlers=self.signal_handlers) def backend_reader(self): """