PortMapping

Trait PortMapping 

Source
pub trait PortMapping: Send + Sync {
    // Required methods
    fn start(
        self: Arc<Self>,
        settings: Arc<AsyncRwLock<Settings>>,
        executor: ExecutorPtr,
    ) -> Result<()>;
    fn stop(self: Arc<Self>);
}
Expand description

Trait for port mapping protocols (UPnP, NAT-PMP, PCP)

Each protocol runs its own persistent task that:

  1. Attempts to discover a gateway
  2. Creates port mappings when gateway is found
  3. Periodically refreshes the external address
  4. Retries discovery on failures (supports roaming)

Required Methods§

Source

fn start( self: Arc<Self>, settings: Arc<AsyncRwLock<Settings>>, executor: ExecutorPtr, ) -> Result<()>

Start the port mapping protocol - runs forever with retries

Source

fn stop(self: Arc<Self>)

Stop the port mapping protocol

Implementors§