Skip to content

Commit

Permalink
Merge pull request #21 from richardschneider/domain-name
Browse files Browse the repository at this point in the history
use DomainName not a string
  • Loading branch information
richardschneider committed Jul 5, 2019
2 parents c947dde + 0fb7707 commit ad9df26
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/DnsClientBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public ushort NextQueryId()

/// <inheritdoc />
public async Task<IEnumerable<IPAddress>> ResolveAsync(
string name,
DomainName name,
CancellationToken cancel = default(CancellationToken))
{
var a = QueryAsync(name, DnsType.A, cancel);
Expand All @@ -45,7 +45,7 @@ public ushort NextQueryId()

/// <inheritdoc />
public Task<Message> QueryAsync(
string name,
DomainName name,
DnsType rtype,
CancellationToken cancel = default(CancellationToken))
{
Expand All @@ -61,7 +61,7 @@ public ushort NextQueryId()

/// <inheritdoc />
public Task<Message> SecureQueryAsync(
string name,
DomainName name,
DnsType rtype,
CancellationToken cancel = default(CancellationToken))
{
Expand All @@ -76,7 +76,7 @@ public ushort NextQueryId()
}

/// <inheritdoc />
public async Task<string> ResolveAsync(
public async Task<DomainName> ResolveAsync(
IPAddress address,
CancellationToken cancel = default(CancellationToken))
{
Expand Down
10 changes: 5 additions & 5 deletions src/IDnsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public interface IDnsClient : IDisposable, IResolver
/// Get the IP addresses for the specified name.
/// </summary>
/// <param name="name">
/// A domain name.
/// A domain name to resolve.
/// </param>
/// <param name="cancel">
/// Is used to stop the task. When cancelled, the <see cref="TaskCanceledException"/> is raised.
Expand All @@ -57,7 +57,7 @@ public interface IDnsClient : IDisposable, IResolver
/// contains the <see cref="IPAddress"/> sequence for the <paramref name="name"/>.
/// </returns>
Task<IEnumerable<IPAddress>> ResolveAsync(
string name,
DomainName name,
CancellationToken cancel = default(CancellationToken));

/// <summary>
Expand All @@ -80,7 +80,7 @@ public interface IDnsClient : IDisposable, IResolver
/// Creates a query <see cref="Message"/> and then calls <see cref="QueryAsync(Message, CancellationToken)"/>.
/// </remarks>
Task<Message> QueryAsync(
string name,
DomainName name,
DnsType rtype,
CancellationToken cancel = default(CancellationToken));

Expand All @@ -105,7 +105,7 @@ public interface IDnsClient : IDisposable, IResolver
/// </remarks>
/// <seealso cref="Message.UseDnsSecurity"/>
Task<Message> SecureQueryAsync(
string name,
DomainName name,
DnsType rtype,
CancellationToken cancel = default(CancellationToken));

Expand All @@ -128,7 +128,7 @@ public interface IDnsClient : IDisposable, IResolver
/// Performs a reverse lookup with a <see cref="DnsType.PTR"/>. The
/// response contains the name(s) of the <paramref name="address"/>.
/// </remarks>
Task<string> ResolveAsync(
Task<DomainName> ResolveAsync(
IPAddress address,
CancellationToken cancel = default(CancellationToken));

Expand Down
2 changes: 1 addition & 1 deletion src/Udns.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<ItemGroup>
<PackageReference Include="Common.Logging" Version="3.4.1" />
<PackageReference Include="Makaretu.Dns" Version="1.5.0" />
<PackageReference Include="Makaretu.Dns" Version="2.0.0" />
<PackageReference Include="Nito.AsyncEx" Version="5.0.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion test/DnsClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public async Task Resolve_Reverse()
foreach (var address in addresses)
{
var name = await dns.ResolveAsync(address);
StringAssert.EndsWith(name, ".com");
StringAssert.EndsWith(name.ToString(), ".com");
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/DohClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public async Task Resolve_Reverse()
foreach (var address in addresses)
{
var name = await doh.ResolveAsync(address);
StringAssert.EndsWith(name, ".com");
StringAssert.EndsWith(name.ToString(), ".com");
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/DotClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public async Task Resolve_Reverse()
foreach (var address in addresses)
{
var name = await dot.ResolveAsync(address);
StringAssert.EndsWith(name, ".com");
StringAssert.EndsWith(name.ToString(), ".com");
}
}
}
Expand Down

0 comments on commit ad9df26

Please sign in to comment.