(host)
| 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 |