Ajay Patel

Ajay Patel

  • NA
  • 147
  • 251.8k

Use Multiple HUB in SignalR

Jun 25 2014 8:30 AM
Hello,
 
I am facing issue to access multiple HUBs in SignalR.  I have 2 HuBs in my Application. It is connected successfully if I do not create any client methods but when I add client method then It gives error:
 
"No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization." 
 
e.g
 
Method to connect :
 
msg = $.connection.messages;
chat = $.connection.chat;
 
chat.client.isActive = function (connectionid) {     // if I add this method before start connection it will give error.   
}
 
 
$.connection.hub.start({ transport: 'auto', xdomain: true }).done(function () {
chat.client.isActive = function (connectionid) { // if I add this method here, then it will not called from HUB
}
})
.fail(function (e) {
alert(e);
});
 
 
HUB:
public class Chat : Hub
{
 
 
public class Messages : Hub
{
 
 
 
 
 What is the issue ???  
 
Please suggest me 
 
Thanks