summary refs log tree commit diff
path: root/synapse/app
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2019-02-13 11:59:04 +0000
committerRichard van der Hoff <richard@matrix.org>2019-02-13 11:59:04 +0000
commit767686af48ecbf5fe999830e0b0ce13b7fd46b1b (patch)
tree282ba1bb3f9e09a8fe48de48346fc3d475dab178 /synapse/app
parentImprove logging around listening services (diff)
downloadsynapse-767686af48ecbf5fe999830e0b0ce13b7fd46b1b.tar.xz
Use `listen_tcp` for the replication listener
Fixes the "can't listen on 0.0.0.0" error. Also makes it more consistent with
what we do elsewhere.
Diffstat (limited to 'synapse/app')
-rwxr-xr-xsynapse/app/homeserver.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index 2b008e3402..dbd9a83877 100755
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -266,14 +266,14 @@ class SynapseHomeServer(HomeServer):
                     )
                 )
             elif listener["type"] == "replication":
-                bind_addresses = listener["bind_addresses"]
-                for address in bind_addresses:
-                    factory = ReplicationStreamProtocolFactory(self)
-                    server_listener = reactor.listenTCP(
-                        listener["port"], factory, interface=address
-                    )
+                services = listen_tcp(
+                    listener["bind_addresses"],
+                    listener["port"],
+                    ReplicationStreamProtocolFactory(self),
+                )
+                for s in services:
                     reactor.addSystemEventTrigger(
-                        "before", "shutdown", server_listener.stopListening,
+                        "before", "shutdown", s.stopListening,
                     )
             elif listener["type"] == "metrics":
                 if not self.get_config().enable_metrics: