util/Zeroconf.py
changeset 1740 b789b695b5c6
parent 1739 ec153828ded2
child 1743 c3c3d1318130
equal deleted inserted replaced
1739:ec153828ded2 1740:b789b695b5c6
  1555 
  1555 
  1556 if __name__ == '__main__':
  1556 if __name__ == '__main__':
  1557     print "Multicast DNS Service Discovery for Python, version", __version__
  1557     print "Multicast DNS Service Discovery for Python, version", __version__
  1558     r = Zeroconf()
  1558     r = Zeroconf()
  1559     print "1. Testing registration of a service..."
  1559     print "1. Testing registration of a service..."
  1560     desc = {'version':'0.10','a':'test value', 'b':'another value'}
  1560     desc = {'version': '0.10', 'a': 'test value', 'b': 'another value'}
  1561     info = ServiceInfo("_http._tcp.local.", "My Service Name._http._tcp.local.", socket.inet_aton("127.0.0.1"), 1234, 0, 0, desc)
  1561     info = ServiceInfo("_http._tcp.local.", "My Service Name._http._tcp.local.", socket.inet_aton("127.0.0.1"), 1234, 0, 0, desc)
  1562     print "   Registering service..."
  1562     print "   Registering service..."
  1563     r.registerService(info)
  1563     r.registerService(info)
  1564     print "   Registration done."
  1564     print "   Registration done."
  1565     print "2. Testing query of service information..."
  1565     print "2. Testing query of service information..."