Skip to content

Commit

Permalink
Change logging of sockets that discovery packets is sent on, due to E…
Browse files Browse the repository at this point in the history
…xception on Windows. Fixes #445.
  • Loading branch information
Kenneth Nielsen committed Nov 3, 2016
1 parent 441b6aa commit 1ee005a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions soco/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,11 @@ def create_socket(interface_addr=None):
address, e.__class__.__name__, e)
# Add a socket using the system default address
_sockets.append(create_socket())
_LOG.info("Sending discovery packets on %s",
list(s.getsockname()[0] for s in _sockets))
# Used to be logged as:
# list(s.getsockname()[0] for s in _sockets)
# but getsockname fails on Windows with unconnected unbound sockets
# https://bugs.python.org/issue1049
_LOG.info("Sending discovery packets on %s", _sockets)

for _ in range(0, 3):
# Send a few times to each socket. UDP is unreliable
Expand Down

0 comments on commit 1ee005a

Please sign in to comment.