darkwing 0 Newbie Poster

Hi all. I'm writing a Python program to subscribe to a multicast group and prints out data it receives. The program works fine if the source is in the same subnet as my receiver. However if the source is on a different subnet, my application just doesn't pick it up (even though wireshark shows data do arrive on the interface). I wrote a similar program in C++ and it works fine, whether or not the source is in the same subnet. So I am wondering if this is a Python specific thing and how do I go about fixing it? Any help is greatly appreciated. I'm posting the code I used to subscribe to the multicast group in Python below.

self.sockfd = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
self.sockfd.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
if hasattr(socket, "SO_REUSEPORT"):
    self.sockfd.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
self.sockfd.bind(('', self.info.multicast_port))
mreq = socket.inet_aton(self.info.multicast_address) + struct.pack('=I', socket.INADDR_ANY)
self.sockfd.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)