Skip to content

Commit

Permalink
py 2.4 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kormoc committed Jan 29, 2014
1 parent 7953cfb commit 1615146
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/collectors/jcollectd/collectd_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,16 @@ def __init__(self, host=None, port=DEFAULT_PORT, multicast=False):
else:
raise ValueError("Unsupported network address family")

if self.ipv6:
sock_type = socket.IPPROTO_IPV6
else:
sock_type = socket.IPPROTO_IP

self._sock.setsockopt(
socket.IPPROTO_IPV6 if self.ipv6 else socket.IPPROTO_IP,
sock_type,
socket.IP_ADD_MEMBERSHIP, val)
self._sock.setsockopt(
socket.IPPROTO_IPV6 if self.ipv6 else socket.IPPROTO_IP,
sock_type,
socket.IP_MULTICAST_LOOP, 0)

self._readlist = [self._sock]
Expand Down

0 comments on commit 1615146

Please sign in to comment.