diff --git a/confluent_server/confluent/discovery/protocols/slp.py b/confluent_server/confluent/discovery/protocols/slp.py index 0ab6ddc6..649c2707 100644 --- a/confluent_server/confluent/discovery/protocols/slp.py +++ b/confluent_server/confluent/discovery/protocols/slp.py @@ -482,7 +482,7 @@ def snoop(handler, protocol=None): known_peers = set([]) peerbymacaddress = {} deferpeers = [] - while r: + while r and len(deferpeers) < 256: for s in r: (rsp, peer) = s.recvfrom(9000) if peer in known_peers: diff --git a/confluent_server/confluent/discovery/protocols/ssdp.py b/confluent_server/confluent/discovery/protocols/ssdp.py index 937a5312..6600ca2d 100644 --- a/confluent_server/confluent/discovery/protocols/ssdp.py +++ b/confluent_server/confluent/discovery/protocols/ssdp.py @@ -173,7 +173,7 @@ def snoop(handler, byehandler=None, protocol=None, uuidlookup=None): if r: r = r[0] recent_peers = set([]) - while r: + while r and len(deferrednotifies) < 256: for s in r: (rsp, peer) = s.recvfrom(9000) if rsp[:4] == b'PING':