Class Extensions
Extension Methods for the exposed interfaces
Inherited Members
Namespace: SharpOpenNat
Assembly: SharpOpenNat.dll
Syntax
public static class Extensions
Methods
| Edit this page View SourceGetAvailablePortAsync(INatDevice, int, CancellationToken)
Get the first available port on the specified device
starting from startingPort
Declaration
public static Task<int> GetAvailablePortAsync(this INatDevice device, int startingPort, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
INat |
device | |
int | startingPort | |
Cancellation |
cancellationToken |
Returns
| Edit this page View SourceGetAvailablePortAsync(INatDiscoverer, int, CancellationToken)
Get the first available port starting from startingPort
on the first found device
Declaration
public static Task<int> GetAvailablePortAsync(this INatDiscoverer discoverer, int startingPort, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
INat |
discoverer | |
int | startingPort | |
Cancellation |
cancellationToken |
Returns
| Edit this page View SourceGetUsedPortsAsync(INatDevice, CancellationToken)
Get all used ports on the specified device
Declaration
public static Task<List<int>> GetUsedPortsAsync(this INatDevice device, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
INat |
device | |
Cancellation |
cancellationToken |
Returns
| Edit this page View SourceGetUsedPortsAsync(INatDiscoverer, CancellationToken)
Get all used ports on the first found device
Declaration
public static Task<List<int>> GetUsedPortsAsync(this INatDiscoverer discoverer, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
INat |
discoverer | |
Cancellation |
cancellationToken |