I want to be able to send message to specific user account with SignalR.
Right now I can send to everyone!
I am looking for any way to have access to context.ConnectionID in controller outside of hub. I tried accessing it inside of controller with iHubContext and inside of hub I tried to save value of connectionID in session but both are not supported.
What would be best way to access connectionID from Controller outside of Hub?
here is action method from ChatController that is used for sending message to everyone
public IActionResult PosaljiPoruku()
{
_hubContext.Clients.All.SendAsync("PrimljenaPoruka", "aaa");
return PartialView("SubmitFormPartial");
}
Any help is appreciated!
Thanks for trying to help!