I have an application SignalRthat has several hubs (hubs are part of different projects within the same solution).
In the interface, I want to start connections based on the component that the user is currently viewing.
Suppose I have 2 hubs and 2 components: TestHub1, TestHub2; Component1, Component2.
In each component, I create a connection as follows:
var testHub = $.connection.testHub;
$.connection.hub.logging = true;
$.connection.hub.start();
});
So, I am doing this in several components. Now, assuming that I have both components connected to TestHub1and TestHub2respectively (at the same time), how can I only stop one connection? If I call in any component $.connection.hub.stop(), both connections of the hub stop.
How can I start and stop hub connections individually? (Because if at some point after I stopped both of them, and I call $.connection.hub.start(), even if I call it from the component that uses TestHub1, TestHub2it will also start the connection.
So, I'm looking for a way to start and stop individual connections to the host, not integer $.connection.start()and $.connection.hub.stop().
Thanks!