Struct p2p::HolePunchMediator
[−]
[src]
pub struct HolePunchMediator { /* fields omitted */ }
The main hole punch mediator engine.
This is responsible for managing all the hole punching details. It has child states to mediate UDP and TCP rendezvous as well as UDP and TCP hole punching. The result will be published to the user via accepted callbacks.
Methods
impl HolePunchMediator
[src]
fn start(ifc: &mut Interface, poll: &Poll, f: GetInfo) -> Res<()>
Start the mediator engine. This will prepare it for the rendezvous. Once rendezvous information is obtained via the given callback, the user is expected to exchange it out of band with the peer and begin hole punching by giving the peer's rendezvous information.
Trait Implementations
impl NatState for HolePunchMediator
[src]
fn timeout(&mut self, ifc: &mut Interface, poll: &Poll, timer_id: u8)
To be called when timeout has been fired and the user has retrieved the state using the token stored inside the NatTimer::associated_nat_state
. Read more
fn terminate(&mut self, ifc: &mut Interface, poll: &Poll)
To be called when user wants to actively terminate this state. It will do all the necessary clean ups and resource (file/socket descriptors) cleaning freeing so merely calling this is sufficient. Read more
fn as_any(&mut self) -> &mut Any
This is for internal use for the crate and is rarely needed.
fn ready(&mut self, &mut Interface, &Poll, Ready)
To be called when readiness event has fired