Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8382059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:50:43+00:00 2026-06-09T16:50:43+00:00

I am using Signalr in an application I’m writing and storing all the user

  • 0

I am using Signalr in an application I’m writing and storing all the user connections in a concurrent dictionary

ConcurrentDictionary<string, User> _users = new ConcurrentDictionary<string, User>();

e.g.
https://github.com/SignalR/SignalR/blob/master/samples/SignalR.Hosting.AspNet.Samples/Hubs/ShapeShare/ShapeShare.cs

I have implemented the IDisconnect interface on my Hub and I’m removing users from the dictionary when they disconnect

I am wondering how reliable the Disconnect method really is?
Does it capture all the different ways that a user could diconnect?
I dont want the dictionary to grow and grow indefinitely

I was thinking of maybe having a timer to periodically traverse the dictionary and remove users who havent had any recent activity

Is this necessary? Can I rely on the disconnect method?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:50:44+00:00Added an answer on June 9, 2026 at 4:50 pm

    Check out https://github.com/SignalR/SignalR/wiki/Configuring-SignalR , there are settings for :

    DisconnectTimeout
    KeepAlive
    & Heatbeat interval

    These could all be applied to help in maintaining your dictionary.

    In my experience a graceful disconnect seems to work perfectly on signalR (still problems with win-apps) , if it ungracefully disconnects in a few minutes the connection will timeout and the disconnect method will fire and remove it from your dictionary like Drew said.

    You could create a method that sends a message to all clients and log the returned connection ID and then remove any entries that are old, but in practice the disconnect method does work/work itself out, I would only implement the heartbeat interval if you really need to keep a very close eye on the connections.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using signalr in my asp.net web forms application, all seems to work good,
I created Chat application using SignalR and Asp.net MVC. if user is idle for
I'm using SignalR in the application I am writing, but I'm confused by examples
I am using SignalR in my MVC3 application, and since I have implemented StructureMap
I am using SignalR in an ASP.Net Web Application project and am having issues.
I am writing a client-server application using sockets in C++. The protocol for communications
I am using signalr and asp.net MVC3 to build a sample chat application. Here
I'm writing a C/C++ application, this application is used directly by the user to
I'm writing an application using Perl and Gtk2-Perl that keeps track of elapsed time.
I have a Silverlight 5 application accessing a server using SignalR. Most of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.