Class DnsSrvResolver
A minimal DNS SRV record (RFC 2782) resolver implemented over raw UDP sockets. .NET's BCL has no public
API for SRV lookups, and Algorand (and Algorand-compatible networks like Voi/Aramid) publish their relay
and archival gossip nodes as SRV records - e.g. "_archive._tcp.mainnet.algorand.network" - specifically
so clients don't have to hardcode node lists that rotate over time.
Inheritance
DnsSrvResolver
Assembly: Algorand.dll
Syntax
public static class DnsSrvResolver
Methods
|
Edit this page
View Source
BuildQuery(string, out ushort)
Declaration
public static byte[] BuildQuery(string serviceName, out ushort transactionId)
Parameters
| Type |
Name |
Description |
| string |
serviceName |
|
| ushort |
transactionId |
|
Returns
|
Edit this page
View Source
EncodeName(string)
Declaration
public static byte[] EncodeName(string name)
Parameters
| Type |
Name |
Description |
| string |
name |
|
Returns
|
Edit this page
View Source
ParseResponse(byte[], ushort?)
Declaration
public static List<DnsSrvRecord> ParseResponse(byte[] response, ushort? expectedTransactionId = null)
Parameters
| Type |
Name |
Description |
| byte[] |
response |
|
| ushort? |
expectedTransactionId |
|
Returns
|
Edit this page
View Source
Resolve(string, int)
Resolves the SRV records for the given service name, ordered by priority (ascending) then weight
(descending), per RFC 2782. Tries the machine's configured DNS servers first, then falls back to
public resolvers if none are configured or none answer.
Declaration
public static List<DnsSrvRecord> Resolve(string serviceName, int timeoutMs = 5000)
Parameters
| Type |
Name |
Description |
| string |
serviceName |
|
| int |
timeoutMs |
|
Returns