dotnet / dotnet/aspnetcore

GRPC Server causing Microsoft.AspNetCore.Connections.ConnectionResetException when listening to IPAddress.Any

Open
#52,952 3 comments 0 reactions 0 assignees View on GitHub
area-grpc
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Describe the bug

When debugging a GRPC server.

I get a Continous exception messages Microsoft.AspNetCore.Connections.ConnectionResetException in System.Private.CoreLib.dll or in System.Net.Security.dll

The code that does this is:
options.Listen(**IPAddress.Any**, portno, ListenOptions =>
{
ListenOptions.UseHttps();
});

If I change it to:

options.Listen(**IPAddress.Loopback,** portno, ListenOptions =>
{
ListenOptions.UseHttps();
});

No exceptions..

Note; The application does work as intended but concerned of a lot of exceptions that there may be a performance hit.

### Expected Behavior

There should not be any exceptions occurring.

### Steps To Reproduce

_No response_

### Exceptions (if any)

Continous Microsoft.AspNetCore.Connections.ConnectionResetException when options.Listen is set to IPAddress.Any

### .NET Version

8.0.100

### Anything else?

.NET SDK:
Version: 8.0.100
Commit: 57efcf1350
Workload version: 8.0.100-manifests.3b83835e

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.100\

.NET workloads installed:
Workload version: 8.0.100-manifests.3b83835e
[android]
Installation Source: SDK 8.0.100, VS 17.9.34407.89
Manifest Version: 34.0.52/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\34.0.52\WorkloadManifest.json
Install Type: Msi

[ios]
Installation Source: SDK 8.0.100, VS 17.9.34407.89
Manifest Version: 17.0.8490/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.0.8490\WorkloadManifest.json
Install Type: Msi

[maccatalyst]
Installation Source: SDK 8.0.100, VS 17.9.34407.89
Manifest Version: 17.0.8490/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\17.0.8490\WorkloadManifest.json
Install Type: Msi

[macos]
Installation Source: SDK 8.0.100
Manifest Version: 14.0.8490/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.macos\14.0.8490\WorkloadManifest.json
Install Type: Msi

[maui]
Installation Source: SDK 8.0.100
Manifest Version: 8.0.3/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.3\WorkloadManifest.json
Install Type: Msi

[maui-windows]
Installation Source: VS 17.9.34407.89
Manifest Version: 8.0.3/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.3\WorkloadManifest.json
Install Type: Msi

Host:
Version: 8.0.0
Architecture: x64
Commit: 5535e31a71

.NET SDKs installed:
7.0.404 [C:\Program Files\dotnet\sdk]
8.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
arm64 [C:\Program Files\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\arm64\InstallLocation]
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.