Struct p2p::Handle
[−]
[src]
pub struct Handle { /* fields omitted */ }
Handle to the HolePunchMediator
.
Using this handle, the user can provide peer rendezvous information to begin hole punching. The handle is flexible enough to invoke hole punching either from another thread or from the event loop thread. The choice is upto the user.
Dropping this handle will clean up all the internal states associated with this handle and the
entire HolePunchMediator
for this handle will terminate gracefully.
Methods
impl Handle
[src]
fn fire_hole_punch(self, peer: RendezvousInfo, f: HolePunchFinsih)
Fire hole punch request from a non-event loop thread.
fn start_hole_punch(ifc: &mut Interface,
poll: &Poll,
hole_punch_mediator: Token,
peer: RendezvousInfo,
f: HolePunchFinsih)
poll: &Poll,
hole_punch_mediator: Token,
peer: RendezvousInfo,
f: HolePunchFinsih)
Request hole punch from within the event loop thread.
fn mediator_token(self) -> Token
Obtain the token associated with the HolePunchMediator to which this is a handle.