Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

Commit

Permalink
use the extended signature of the setsockopt (#148)
Browse files Browse the repository at this point in the history
this fixes `OSError: [Errno 22] Invalid argument` on OpenBSD
follows suggestion at https://bugs.python.org/issue23127
  • Loading branch information
trbs authored and balloob committed Sep 22, 2017
1 parent ed7cf5e commit 8aa20c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion netdisco/gdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
iBaa's PlexConnect: https://github.com/iBaa/PlexConnect/PlexAPI.py
"""
import socket
import struct


class GDM(object):
Expand Down Expand Up @@ -69,7 +70,7 @@ def update(self):
# Set the time-to-live for messages for local network
sock.setsockopt(socket.IPPROTO_IP,
socket.IP_MULTICAST_TTL,
gdm_timeout)
struct.pack("B", gdm_timeout))

try:
# Send data to the multicast group
Expand Down

0 comments on commit 8aa20c6

Please sign in to comment.