-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Description
Describe the bug
When a client disconnects, I expect HttpContext.RequestAborted.IsCancellationRequested to return true. On Kestrel, this is indeed the case. However on HttpSysServer, HttpContext.RequestAborted.IsCancellationRequested returns false despite the client disconnecting.
To Reproduce
-
Fire up any Kestrel sample project in Visual Studio: https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/fundamentals/servers/kestrel/samples/5.x/KestrelSample
-
Fire up any HttpSysServer sample project in Visual Studio: https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/fundamentals/servers/httpsys/samples/3.x/SampleApp
-
Send requests to both servers and abruptly disconnect your client. I've attached a simple TCPClient I used.
TCPClient.zip -
HttpContext.RequestAborted.IsCancellationRequested returns true on Kestrel, returns false on HttpSysServer.
Further technical details
- ASP.NET Core version : 5.0.9