Aspnetcore: How to use a customized ConnectionHandler to force tcp disconnected after a long time without any action

Created on 7 Nov 2019  路  3Comments  路  Source: dotnet/aspnetcore

Hi,when using builder.UseConnectionHandler(), I want to forcefully stop tcp connection which has no action for a long time.How can I achieve this?

area-servers question

All 3 comments

We used to have IConnectionTimeoutFeature that did this, but @davidfowl removed it in 3.0 with https://github.com/aspnet/AspNetCore/pull/11488 because the HTTPS connection handler no longer uses it. I don't think he was a huge fan of the actual API either, but I agree that it's very useful.

Use a Timer/CancellationToken and call Abort on the ConnectionContext. It's currently broken in SignalR though (https://github.com/aspnet/AspNetCore/issues/5329)

Thank you for contacting us. Due to no activity on this issue we're closing it in an effort to keep our backlog clean. If you believe there is a concern related to the ASP.NET Core framework, which hasn't been addressed yet, please file a new issue.

Was this page helpful?
0 / 5 - 0 ratings