Andre Silveira

Andre Silveira

  • 1.6k
  • 155
  • 15.8k

How can I get the current signalR ConnectionId from outside of the hub

Nov 10 2021 11:14 PM

Hi all,

I'm trying to get the current signalR ConnectionId from the current user when he logs in the server, so I can keep track on the database if the user is currently (Identity user) connected or not. I don't find a way to get the current connection on the login.cshtml.cs "code behind" class.. I tryied to inject the IHubContext, but it's not working... it doesn't expose the method get the current ConnectionId. 

. I'm using .net core 5.

Somebody help me please!! 

Thanks in advance.


Answers (2)