Service discovery implementation

class wsdiscovery.discovery.ThreadedWSDiscovery(**kwargs)

Bases: wsdiscovery.daemon.Daemon, wsdiscovery.discovery.Discovery, wsdiscovery.threaded.ThreadedNetworking

Full threaded service discovery implementation

clearRemoteServices()

clears remotely discovered services

searchServices(types=None, scopes=None, address=None, port=None, timeout=3)

search for services given the TYPES and SCOPES in a given TIMEOUT

setRemoteServiceByeCallback(cb)

Set callback, which will be called when new service appeared online and sent Hi message Service is passed as a parameter to the callback Set None to disable callback

setRemoteServiceHelloCallback(cb, types=None, scopes=None)

Set callback, which will be called when new service appeared online and sent Hi message

typesFilter and scopesFilter might be list of types and scopes. If filter is set, callback is called only for Hello messages, which match filter

Set None to disable callback

setRemoveServiceDisappearedCallback(cb)

Set callback, which will be called when new service disappears Service uuid is passed as a parameter to the callback Set None to disable callback

start()

start networking - should be called before using other methods

stop()

cleans up and stops networking