1

I want to use signalR with MVC5. I found two or more nice tutorials but I have one question.

What to use: $.hubConnection or $.connection

As far I understood, first always connect to hub, second use persisted connection. What is better?

mbrc
  • 3,523
  • 13
  • 40
  • 64
  • 3
    Possible duplicate of [SignalR: Why choose Hub vs. Persistent Connection?](http://stackoverflow.com/questions/9280484/signalr-why-choose-hub-vs-persistent-connection) – mason Jan 10 '17 at 15:37
  • i thought `$.connection` was given to you by the generated proxy, and `$.hubConnection` you would use when you aren't referencing the generated proxy. From the docs, `$.connection.hub` refers to the same object as `$.hubConnection()` – Jonesopolis Jan 10 '17 at 15:41
  • There is no "what's better" - it depends on the scenario. hubs is a dispatching mechanism built on top of persistent connection. – Pawel Jan 10 '17 at 21:40

0 Answers0