-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Open
Labels
affected-very-fewThis issue impacts very few customersThis issue impacts very few customersarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.severity-nice-to-haveThis label is used by an internal toolThis label is used by an internal tool
Milestone
Description
Describe the bug
AspNetCore 2.1 doesn't automatically close the socket when a ConnectionHandler's OnConnectedAsync returned Task completes. On AspNetCore 2.2, the socket is automatically closed on Task completion. If the connection handler implementation never closes the socket, then the socket remains open indefinitely, even after Dispose has been called on the IWebHost.
To Reproduce
Steps to reproduce the behavior:
- Using this version of ASP.NET Core '2.1'
- Create a connection handler which returns a completed Task. Start the webhost and create a connection to the configured port. Dispose the webhost. Clients socket remains connected and is able to call send and receive on the socket (which don't complete as there's nothing reading or writing on the server side of the socket).
Expected behavior
When calling Dispose on the webhost, all sockets will get disconnected.
Additional context
I discovered this when developing CoreWCF. If you need a repro, I can make a custom branch where our unit tests fail demonstrating this issue.
Metadata
Metadata
Assignees
Labels
affected-very-fewThis issue impacts very few customersThis issue impacts very few customersarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.severity-nice-to-haveThis label is used by an internal toolThis label is used by an internal tool