Class MultiAddressExtensions
Extensions to MultiAddress.
Inherited Members
Namespace: PeerTalk
Assembly: PeerTalk.dll
Syntax
public static class MultiAddressExtensions
Methods
| Improve this Doc View SourceIsLoopback(MultiAddress)
Determines if the multiaddress references a loopback address.
Declaration
public static bool IsLoopback(this MultiAddress multiaddress)
Parameters
Type | Name | Description |
---|---|---|
MultiAddress | multiaddress | The mutiaddress to clone. |
Returns
Type | Description |
---|---|
Boolean | true for a loopback (127.0.0.1 or ::1). |
ResolveAsync(MultiAddress, CancellationToken)
Get all the addresses for the specified MultiAddress.
Declaration
public static Task<List<MultiAddress>> ResolveAsync(this MultiAddress multiaddress, CancellationToken cancel = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
MultiAddress | multiaddress | The multiaddress to resolve. |
CancellationToken | cancel | Is used to stop the task. When cancelled, the TaskCanceledException is raised. |
Returns
Type | Description |
---|---|
Task<List<MultiAddress>> | A task that represents the asynchronous operation. The task's result is a sequence of possible multiaddresses. |
Remarks
When the Name starts with "dns", then a DNS lookup is performed to get all the IP addresses for the host name. "dn4" and "dns6" will filter the result for IPv4 and IPV6 addresses.
When the Name is "http" or "https", then a "tcp/80" or "tcp/443" is respectively added.
Exceptions
Type | Condition |
---|---|
SocketException | The host name cannot be resolved. |