It seemed to me that recvfrom () gave you the next packet on the IP address that it is listening on, and if it does not skip listening packets. We have a problem where the problem may be related to packages for recvfrom (), so it listens and captures all packages, even if recvfrom () is not actively listening.
I could not find the final documentation on this. Does anyone know for sure that the characteristics of recvfrom () are not packet queues when they are not called?
Code example
:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) mcast_g = socket.inet_aton(group) mreq = struct.pack('4sL', mcast_g, socket.INADDR_ANY) s.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq) s.bind(('', port)) while True: data, sender = s.recvfrom(1500) # Do stuff # Are packets being queued up here?
source share