Posted By

yarvin on 01/23/08


Tagged

python configuration zero networking Zeroconf


Versions (?)

Zeroconf and Python


 / Published in: Python
 

URL: http://www.amk.ca/python/zeroconf

taken from http://www.amk.ca/python/zeroconf

  1. import Zeroconf
  2. import socket
  3.  
  4. server = Zeroconf.Zeroconf()
  5.  
  6. # Get local IP address
  7. local_ip = socket.gethostbyname(socket.gethostname())
  8. local_ip = socket.inet_aton(local_ip)
  9.  
  10. svc1 = Zeroconf.ServiceInfo('_durus._tcp.local.',
  11. 'Database 1._durus._tcp.local.',
  12. address = local_ip,
  13. port = 2972,
  14. weight = 0, priority=0,
  15. properties = {'description':
  16. 'Departmental server'}
  17. )
  18. server.registerService(svc1)

Report this snippet  

You need to login to post a comment.