Skip to main content

local_ipv4

Function local_ipv4 

Source
pub fn local_ipv4() -> Option<Ipv4Addr>
Expand description

The client’s primary IPv4, via the routing table — bind a UDP socket and “connect” it to a public address (no packet is sent; this just selects the default-route interface), then read the local address. None if there is no usable route (e.g. an isolated host); the caller then needs --subnet.