SignalR Hub - Check for incomming or outgoing data

Marcel Lorenz 81 Reputation points

I want to implement the feature to properly shut down all SignalR hubs before shutting down, the server, to roll out a new application version. I want the REST API to finish all currently managed requests but not to accept new requests. That's already implemented. Also, I want to shut down all hubs. The problem is that a REST requests connection is closed when it's done, so it's easy to determine if there are still requests, that have to be finished. But a Hub connection is always active unless it's closed on purpose or something went wrong. So I want to shut down the hub if no data is currently transmitted. Is there a way to check for this information?

A set of technologies in the .NET Framework for building web applications and XML web services.
3,319 questions
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,401 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce ( 58,121 Reputation points

    you should add a broadcast message to clients, telling them to disconnect, perhaps with time to wait before reconnect..

  2. Jose Zero 576 Reputation points

    This article might help you or at least give an starting point

    0 comments No comments