Struct iroh_net_report::Addr
source · pub struct Addr { /* private fields */ }
Expand description
Sender to the main service.
Unlike Client
this is the raw channel to send messages over. Keeping this alive
will not keep the actor alive, which makes this handy to pass to internal tasks.
Implementations§
source§impl Addr
impl Addr
sourcepub fn receive_stun_packet(&self, payload: Bytes, src: SocketAddr)
pub fn receive_stun_packet(&self, payload: Bytes, src: SocketAddr)
Pass a received STUN packet to the net_reporter.
Normally the UDP sockets to send STUN messages from are passed in so that STUN packets are sent from the sockets that carry the real traffic. However because these sockets carry real traffic they will also receive non-STUN traffic, thus the net_report actor does not read from the sockets directly. If you receive a STUN packet on the socket you should pass it to this method.
It is safe to call this even when the net_report actor does not currently have any in-flight STUN probes. The actor will simply ignore any stray STUN packets.
There is an implicit queue here which may drop packets if the actor does not keep up consuming them.