Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client.close() throws Error: client is closed #72

Open
brw opened this issue Sep 26, 2024 · 0 comments
Open

client.close() throws Error: client is closed #72

brw opened this issue Sep 26, 2024 · 0 comments

Comments

@brw
Copy link

brw commented Sep 26, 2024

Calling client.close() will always throw Error: client is closed (with UPnP at least) because the unmap calls check whether the client is closed, but they happen after this.client.close(). I imagine this is as simple as just moving the this.client.close() to the end but wasn't sure if there was more to it.

if (this.client != null) {
log('Close UPnP client')
await this.client.close()
}
// stop all updates
for (const interval of this.updateIntervals.values()) {
clearInterval(interval)
}
this.updateIntervals.clear()
// Unmap all ports
await Promise.all(
this.openPorts.map(async opts => this.unmap(opts))
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant