Class StunDiscovery
Finds the public address of this computer, as a STUN server sees it: e.g. the router's address behind NAT.
Inherited Members
Namespace: Uniform.Stun
Assembly: Uniform.Stun.dll
Syntax
public static class StunDiscovery
Methods
| Edit this page View SourceGetPublicAddressAsync(IPEndPoint, IPAddress?, CancellationToken)
Return the address server sees requests from local come from, or null when it does not answer.
Declaration
public static Task<IPAddress?> GetPublicAddressAsync(IPEndPoint server, IPAddress? local = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IPEndPoint | server | The STUN server, e.g. port 3478 of a TURN server. |
| IPAddress | local | Local address to send from, as on computers with several networks the route depends on it; any when null. |
| CancellationToken | cancellationToken | Cancels the request. |
Returns
| Type | Description |
|---|---|
| Task<IPAddress> |