Skip to content

Commit 1ee00b3

Browse files
committed
Reuse one Zeroconf instance in browser example
1 parent fba4215 commit 1ee00b3

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

examples/browser.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99

1010
class MyListener(object):
1111

12-
def __init__(self):
13-
self.r = Zeroconf()
14-
1512
def removeService(self, zeroconf, type, name):
1613
print()
1714
print("Service %s removed" % (name,))
@@ -20,7 +17,7 @@ def addService(self, zeroconf, type, name):
2017
print()
2118
print("Service %s added" % (name,))
2219
print(" Type is %s" % (type,))
23-
info = self.r.getServiceInfo(type, name)
20+
info = zeroconf.getServiceInfo(type, name)
2421
if info:
2522
print(" Address is %s:%d" % (socket.inet_ntoa(info.getAddress()),
2623
info.getPort()))

0 commit comments

Comments
 (0)