title: SignalR server doesn't consistently call methods on client
body: <p>I have an AngularJS application that I intend to have receive communications via SignalR from the server, most notably when data changes and I want the client to refresh itself.</p>
  
  <p>The following is my hub logic:</p>
  
  <pre><code>[HubName("update")]
      public class SignalRHub : Hub
      {
          public static void SendDataChangedMessage(string changeType)
          {
              var context = GlobalHost.ConnectionManager.GetHubContext&lt;SignalRHub&gt;();
              context.Clients.All.ReceiveDataChangedMessage(changeType);
          }
      }
  </code></pre>
  
  <p>I use the following within my API after the data operation has successfully occurred to send the message to the clients:</p>
  
  <pre><code>SignalRHub.SendDataChangedMessage("newdata");
  </code></pre>
  
  <p>Within my AngularJS application, I create a service for SignalR with the following javascript that's referenced in the HTML page:</p>
  
  <pre><code>angular.module('MyApp').value('signalr', $.connection.update);
  </code></pre>
  
  <p>Within the root for the AngularJS module, I set this up with the following so that it starts and I can see the debug output:</p>
  
  <pre><code>$(function () {
      $.connection.hub.logging = true;
      $.connection.hub.start();
  });
  
  $.connection.hub.error(function(err) {
      console.log('An error occurred: ' + err);
  });
  </code></pre>
  
  <p>Then I've got my controller. It's got all sorts of wonderful things in it, but I'll show the basics as relate to this issue:</p>
  
  <pre><code>angular.module('MyApp').controller('MyController', function($scope, signalr) {
    signalr.client.ReceiveDataChangedMessage = function dataReceived(changeType) {
      console.log('DataChangedUpdate: ' + changeType);
    };
  });
  </code></pre>
  
  <p>Unfortunately, when I set a breakpoint in the javascript, this never executes though the rest of the program works fine (including performing the operation in the API).</p>
  
  <p>Some additional (hopefully) helpful information:</p>
  
  <ul>
  <li><p>If I set a breakpoint in the SignalRHub class, the method is successfully called as expected and throws no exceptions.</p></li>
  <li><p>If I look at Fiddler, I can see the polling operations but never see any sign of the call being sent to the client.</p></li>
  <li><p>The Chrome console shows that the AngularJS client negotiates the websocket endpoint, it opens it, initiates the start request, transitions to the connected state, and monitors the keep alive with a warning and connection lost timeout. There's no indication that the client ever disconnects from the server.</p></li>
  <li><p>I reference the proxy script available at <code>http://localhost:port/signalr/hubs</code> in my HTML file so I disregard the first error I receive stating that no hubs have been subscribed to. Partly because the very next message in the console is the negotiation with the server and if I later use '$.connection.hub' in the console, I'll see the populated object.</p></li>
  </ul>
  
  <p>I appreciate any help you can provide. Thanks!</p>