Background
Following along this question, I am having a problem with trying to "tell" the user that called in the first place and nobody else.
As part of the discovery phase of looking for quick and dirty solutions, I was told that SignalR would be a good choice to aid in discovery and feedback. However, I was told that it would only be for testing and never for production.
Later, management changes their mind.
So now I'm thrust into buttoning up this project and getting it ready for launch. I made this to be quick and dirty, so I have one flaw that I don't know how to fix efficiently. I tell it to broadcast to all, but I need it to broadcast to only one client.
Current Implementation
The code will have lots of things cut out, but it should give the jist of it. First, the controller.
public class HomeController : Controller
{
HubResponder hub = new HubResponder();
public String RunProcess(FormCollection ProcessingInfo)
{
hub.SignalUser("String");
}
}
The thing that I see here is that since I construct the hub from the controller instead of the client it isn't receiving client information. I also cannot turn it into a hub since it already inherits Controller. Here's the hub:
public class HubResponder : Hub
{
public void SignalUser(String Outbound)
{
IHubContext context = GlobalHost.ConnectionManager.GetHubContext<HubResponder>();
context.Clients.All.sendStatus(Outbound);
}
}
Now this works but it says send to everyone, which will be confusing.