mirror of
https://github.com/django/daphne.git
synced 2024-11-11 02:26:35 +03:00
parent
a69d69490b
commit
3161715238
|
@ -121,10 +121,19 @@ class Server(object):
|
|||
logger.info("Listening on endpoint %s" % socket_description)
|
||||
# Twisted requires str on python2 (not unicode) and str on python3 (not bytes)
|
||||
ep = serverFromString(reactor, str(socket_description))
|
||||
self.listeners.append(ep.listen(self.factory))
|
||||
listener = ep.listen(self.factory)
|
||||
listener.addErrback(self.on_listener_error)
|
||||
self.listeners.append(listener)
|
||||
|
||||
reactor.run(installSignalHandlers=self.signal_handlers)
|
||||
|
||||
def on_listener_error(self, failure):
|
||||
"""
|
||||
Callback function used to process interface listener errors.
|
||||
"""
|
||||
|
||||
logger.error(failure.getErrorMessage())
|
||||
|
||||
def backend_reader_sync(self):
|
||||
"""
|
||||
Runs as an-often-as-possible task with the reactor, unless there was
|
||||
|
|
Loading…
Reference in New Issue
Block a user