[stream-refactor] fix unix.Listener construction

This commit is contained in:
David Wilson 2019-07-22 18:21:53 +01:00
parent 1fb3852fa6
commit 26b6333787
2 changed files with 3 additions and 3 deletions

View File

@ -308,7 +308,7 @@ class MuxProcess(object):
self._setup_responder(self.router.responder)
mitogen.core.listen(self.broker, 'shutdown', self.on_broker_shutdown)
mitogen.core.listen(self.broker, 'exit', self.on_broker_exit)
self.listener = mitogen.unix.Listener(
self.listener = mitogen.unix.Listener.build_stream(
router=self.router,
path=self.unix_listener_path,
backlog=C.DEFAULT_FORKS,

View File

@ -118,9 +118,9 @@ class Listener(mitogen.core.Protocol):
raise
def on_shutdown(self, broker):
broker.stop_receive(self)
broker.stop_receive(self.stream)
self._unlink_socket()
self.receive_side.close()
self.stream.receive_side.close()
def on_accept_client(self, sock):
sock.setblocking(True)