MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / constructor

Method constructor

modules/network/mdns/mdns.js:40–53  ·  view source on GitHub ↗
(dictionary = {}, callback)

Source from the content-addressed store, hash-verified

38
39class MDNS extends Socket {
40 constructor(dictionary = {}, callback) {
41 super({kind: "UDP", port: MDNS.PORT, multicast: MDNS.IP});
42
43 this.services = [];
44 this.monitors = [];
45 this.client = callback ?? function() {};
46
47 if (dictionary.hostName) {
48 this.hostName = dictionary.hostName;
49 this.hostNameLower = this.hostName.toLowerCase();
50 this.probing = 1;
51 Timer.set(() => this.probe(), 0);
52 }
53 }
54 close() {
55 while (this.services.length)
56 this.remove(this.services[0]);

Callers

nothing calls this directly

Calls 2

probeMethod · 0.95
setMethod · 0.65

Tested by

no test coverage detected