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

Method advertiseServer

contributed/modClock/main.js:338–353  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

336 }
337
338 advertiseServer() {
339 let name = this.prefs.name;
340 if (this.usingAP)
341 name = ap_name;
342
343 this.mdns = new MDNS({hostName: name, prefs: this.prefs}, function(message, value) {
344 if (1 === message) {
345 if ('' !== value) {
346 if (value !== clock.prefs.name) {
347 clock.prefs.name = value;
348 }
349 }
350 }
351 });
352 this.mdns.clock = this;
353 }
354
355 checkName(newName, oldName) {
356 if ((undefined !== newName) && (newName.length > 3) && (newName != oldName)) {

Callers 1

configServerMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected