()
| 317 | } |
| 318 | |
| 319 | async startUPnPMapping () { |
| 320 | const btPort = this.configManager.getSystemConfig('listen-port') |
| 321 | const dhtPort = this.configManager.getSystemConfig('dht-listen-port') |
| 322 | |
| 323 | const promises = [ |
| 324 | this.upnp.map(btPort), |
| 325 | this.upnp.map(dhtPort) |
| 326 | ] |
| 327 | try { |
| 328 | await Promise.allSettled(promises) |
| 329 | } catch (e) { |
| 330 | logger.warn('[Motrix] start UPnP mapping fail', e.message) |
| 331 | } |
| 332 | } |
| 333 | |
| 334 | async stopUPnPMapping () { |
| 335 | const btPort = this.configManager.getSystemConfig('listen-port') |
no test coverage detected