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

Method start

modules/network/sntp/sntp.js:47–61  ·  view source on GitHub ↗
(host)

Source from the content-addressed store, hash-verified

45 this.start(dictionary.host);
46 }
47 start(host) {
48 this.#retry = 5;
49
50 Net.resolve(host, (host, address) => {
51 if (!this.#timer) return; // resolution completed after SNTP closed
52
53 if (address) {
54 this.#address = address;
55 this.write();
56 Timer.schedule(this.#timer, 5000, 5000);
57 }
58 else
59 this.failed("cannot resolve " + host);
60 });
61 }
62 failed(message) {
63 if (this.read())
64 this.read(null); // clear unread data from current packet

Callers 2

constructorMethod · 0.95
failedMethod · 0.95

Calls 4

writeMethod · 0.95
failedMethod · 0.95
scheduleMethod · 0.80
resolveMethod · 0.45

Tested by

no test coverage detected