rust-libp2p icon indicating copy to clipboard operation
rust-libp2p copied to clipboard

UPnP port mappings should be deleted on graceful shutdown

Open mickvandijke opened this issue 1 year ago • 1 comments

Description

UPnP port mappings should be deleted on graceful shutdown.

Motivation

The lease time for opened UPnP port mappings is quite long. It would be decent to remove any created port mappings on shutdown.

Current Implementation

On shutdown, port mappings just stay alive until the lease time is up.

Are you planning to do it yourself in a pull request ?

No

mickvandijke avatar Aug 05 '24 15:08 mickvandijke

Hi, this is quite complex and complicated to achieve without async Drop¹. That's why also we introduced the TTL, so that mappings are not permanent. Can't you remove the listener and wait for the ExpiredListenAddr event on your application? It will trigger the removal of the upnp mappings

jxs avatar Aug 05 '24 15:08 jxs