Skip to content

AddSignalR ClientTimeoutInterval doesn't work #48147

@devsienko

Description

@devsienko

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I have an Asp.Net Core 6 Web Api project. I add SignalR middleware:

builder.Services.AddSignalR(options => { options.ClientTimeoutInterval = TimeSpan.FromSeconds(7); });

I add a handler:

app.MapConnectionHandler<SocialWeatherConnectionHandler>("/weather");

When I turn off client internet connection I don't get any notifications/exceptions. It seem I don't have any way to know whether my client is alive or not.

P.S. When I just close an mobile app or a browser tab I can track it.

Expected Behavior

To get an expection or something like that.

Steps To Reproduce

  1. Create a simple Asp.Net Core 6 Web Api application.
  2. Add the SignalR middleware:

builder.Services.AddSignalR(options => { options.ClientTimeoutInterval = TimeSpan.FromSeconds(7); });

  1. Add a simple handler:

app.MapConnectionHandler<SocialWeatherConnectionHandler>("/weather");

  1. Use any web client to connect to the server application by WebSocket on a different machine. After you connect to the server turn off internet connectoin on the client machine.

  2. Nothing happens on the server side.

You can use client from https://github.com/aspnet/SignalR/tree/master/samples/SocialWeather/wwwroot/index.html as well as SocialWeatherConnectionHandler.

Exceptions (if any)

No response

.NET Version

net6.0

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Status: Resolvedarea-signalrIncludes: SignalR clients and servers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions