NatDiscoverer..::..DiscoverDeviceAsync Method (PortMapper, CancellationTokenSource)
Discovers and returns a NAT device for the specified type; otherwise a NatDeviceNotFoundException
exception is thrown when it is cancelled.
Namespace:
com.onlineobject.objectnetAssembly: ObjectNetAPI (in ObjectNetAPI.dll)
Syntax
public Task<NatDevice> DiscoverDeviceAsync( PortMapper portMapper, CancellationTokenSource cancellationTokenSource )
Parameters
- portMapper
- Type: com.onlineobject.objectnet..::..PortMapper
Port mapper protocol; Upnp, Pmp or both
- cancellationTokenSource
- Type: CancellationTokenSource
Cancellation token source for cancelling the discovery process
Return Value
A NAT deviceExceptions
Exception | Condition |
---|---|
com.onlineobject.objectnet..::..NatDeviceNotFoundException | when no NAT found before cancellation |