Skip to content

Commit 5369d88

Browse files
authored
Merge pull request #151 from bakwc/bindAllInterfacesByDefault
Binding all interfaces by default
2 parents 296a54d + a234b86 commit 5369d88

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

appveyor.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ environment:
33
matrix:
44

55
- PYTHON: "C:\\Python27"
6-
- PYTHON: "C:\\Python34"
6+
# - PYTHON: "C:\\Python34"
77
- PYTHON: "C:\\Python35"
8-
# - PYTHON: "C:\\Python36"
8+
- PYTHON: "C:\\Python38"
99

1010
install:
11+
- "%PYTHON%\\python.exe -m pip install --upgrade pip"
1112
- "%PYTHON%\\python.exe -m pip install pytest"
1213
- "%PYTHON%\\python.exe -m pip install cryptography"
1314

pysyncobj/transport.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,18 @@ def _createServer(self):
259259
"""
260260

261261
conf = self._syncObj.conf
262-
bindAddr = conf.bindAddress or getattr(self._selfNode, 'address')
263-
if not bindAddr:
262+
bindAddr = conf.bindAddress
263+
seflAddr = getattr(self._selfNode, 'address')
264+
if bindAddr is not None:
265+
host, port = bindAddr.rsplit(':', 1)
266+
elif seflAddr is not None:
267+
host, port = seflAddr.rsplit(':', 1)
268+
host = '0.0.0.0'
269+
else:
264270
raise RuntimeError('Unable to determine bind address')
265-
host, port = bindAddr.rsplit(':', 1)
266-
host = globalDnsResolver().resolve(host)
271+
272+
if host != '0.0.0.0':
273+
host = globalDnsResolver().resolve(host)
267274
self._server = TcpServer(self._syncObj._poller, host, port, onNewConnection = self._onNewIncomingConnection,
268275
sendBufferSize = conf.sendBufferSize,
269276
recvBufferSize = conf.recvBufferSize,

0 commit comments

Comments
 (0)