Struct nat_traversal::MappingContext
[−]
[src]
pub struct MappingContext { // some fields omitted }
You need to create a MappingContext
before doing any socket mapping. This
MappingContext
should ideally be kept throughout the lifetime of the
program. Internally it caches a addresses of UPnP servers and hole punching
servers.
Methods
impl MappingContext
[src]
fn new() -> WResult<MappingContext, MappingContextNewWarning, MappingContextNewError>
Create a new mapping context. This will block breifly while it searches the network for UPnP servers.
fn add_simple_udp_servers<S>(&self, servers: S) where S: IntoIterator<Item=SocketAddr>
Inform the context about external servers that speak the UDP simple hole punch server protocol.
fn add_simple_tcp_servers<S>(&self, servers: S) where S: IntoIterator<Item=SocketAddr>
Inform the context about external servers that speak the TCP simple hole punch server protocol.