MCPcopy Create free account
hub / github.com/andreikop/python-ws-discovery / publishService

Method publishService

wsdiscovery/publishing.py:44–57  ·  view source on GitHub ↗

Publish a service with the given TYPES, SCOPES and XAddrs (service addresses) if xAddrs contains item, which includes {ip} pattern, one item per IP address will be sent

(self, types, scopes, xAddrs)

Source from the content-addressed store, hash-verified

42
43
44 def publishService(self, types, scopes, xAddrs):
45 """Publish a service with the given TYPES, SCOPES and XAddrs (service addresses)
46
47 if xAddrs contains item, which includes {ip} pattern, one item per IP address will be sent
48 """
49
50 if not self._serverStarted:
51 raise Exception("Server not started")
52
53 instanceId = _generateInstanceId()
54
55 service = Service(types, scopes, xAddrs, self.uuid, instanceId)
56 self._localServices[self.uuid] = service
57 self._sendHello(service)
58
59
60 def clearLocalServices(self):

Callers 1

publishFunction · 0.80

Calls 3

_generateInstanceIdFunction · 0.85
ServiceClass · 0.85
_sendHelloMethod · 0.80

Tested by

no test coverage detected