Skip to content

Commit 155f7a5

Browse files
committed
react to feedback
1 parent f5b40ca commit 155f7a5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

aspnetcore/diagnostics/asp0028.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ uid: diagnostics/asp0028
1717

1818
## Cause
1919

20+
[IPv6Any](/dotnet/api/system.net.ipaddress.ipv6any) is preferred to [Any](/dotnet/api/system.net.ipaddress.any) because `Any` can be slower than `IPv6Any`. In some cases, `Any` may not work at all. `Any` can be slower due to the [underlying System types implementation](https://github.com/dotnet/runtime/issues/82404). Servers that support `IPv6` my report the `ASP0028` diagnostic message.
21+
22+
<!--
2023
[IPv6Any](/dotnet/api/system.net.ipaddress.ipv6any) is preferred to [Any](/dotnet/api/system.net.ipaddress.any) because `Any` is less performant than `IPv6Any`. In some cases, `Any` may not work at all. `Any` has performance problems due to the [underlying System types implementation](https://github.com/dotnet/runtime/issues/82404).
24+
-->
2125

2226
`127.0.0.1` is the IPv4 loopback address. `::1` is the IPv6 loopback address. `Any` is the wildcard address for IPv4. `IPv6Any` is the wildcard address for IPv6.
2327

@@ -43,21 +47,23 @@ The recommended way to configure Kestrel to listen for incoming connections on a
4347

4448
For the problematic code, replace `Any` with `IPv6Any`:
4549

50+
Use the [ListenAnyIP](https://source.dot.net/#Microsoft.AspNetCore.Server.Kestrel.Core/KestrelServerOptions.cs,1c84a7db2c1f6892) method without specifying any arguments:
51+
4652
```diff
4753
.UseKestrel().ConfigureKestrel(options =>
4854
{
4955
- options.Listen(IPAddress.Any, ...);
50-
+ options.Listen(IPAddress.IPv6Any, ...);
56+
+ options.ListenAnyIP(...);
5157
})
5258
```
5359

54-
Alternatively, use the [ListenAnyIP](https://source.dot.net/#Microsoft.AspNetCore.Server.Kestrel.Core/KestrelServerOptions.cs,1c84a7db2c1f6892) method without specifying any arguments:
60+
Alternatively, use the `IPv6Any` method:
5561

5662
```diff
5763
.UseKestrel().ConfigureKestrel(options =>
5864
{
5965
- options.Listen(IPAddress.Any, ...);
60-
+ options.ListenAnyIP(...);
66+
+ options.Listen(IPAddress.IPv6Any, ...);
6167
})
6268
```
6369

0 commit comments

Comments
 (0)