title: Server to client messages not going through with SignalR in ASP.NET MVC 4
body: <p>I created a simple test app to reproduce a problem I'm having in my main app.</p>
  
  <p>I have the following hub class:</p>
  
  <pre><code>[HubName("testHub")]
  public class TestHub : Hub
  {
      public TestHub()
      {
          System.Diagnostics.Debug.WriteLine("TestHub instantiated");
      }
  
      public void RunMe()
      {
          System.Diagnostics.Debug.WriteLine("Client Started");
      }
  
      public static void Notify(string msg)
      {
          var hubContext = GlobalHost.ConnectionManager.GetHubContext&lt;TestHub&gt;();
          hubContext.Clients.All.notify("Hello!");
      }
  }
  </code></pre>
  
  <p>My test web page is:</p>
  
  <pre><code>&lt;form action="javascript: void(0)" method="post"&gt;
      &lt;input type="button" value="Do It!" onclick="hitHub()"/&gt;
  &lt;/form&gt;
  
  &lt;div id="error"&gt;&lt;/div&gt;
  &lt;script type="text/javascript"&gt;
      var tHub;    
      $(document).ready(function () {
          tHub = $.connection.testHub;
          tHub.notify = function (msg) {
              alert(msg);
          }
          $.connection.hub.start().done(function () {
              tHub.server.runMe();
          });
      });
  
      function hitHub() {
          $.ajax({
              type: "POST",
              url: "@Url.Content("~/Hub/Test")" ,
              success: function (data, textStatus, jqXHR) {
              },
              error: function (data, textStatus, jqXHR) {
                  $("#error")[0].innerHTML = data.responseText;
                  alert("Error notifying hub.");
              }
          });
  
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>And finally, my HubController:</p>
  
  <pre><code>public class HubController : Controller
  {
      [AcceptVerbs(HttpVerbs.Post)]
      public void Test()
      {
          TestHub.Notify("Got it!");
      }
  }
  </code></pre>
  
  <p>In my Application_Start, I call RouteTable.Routes.MapHubs();</p>
  
  <p>The hub gets instantiated. Then the call to runMe() gets passed to the server. This all works fine.</p>
  
  <p>Where it fails is when I click on the "Do It!" button. hitHub() gets called and my HubController.Test() method gets called. TestHub.Notify("Got it!") gets executed without any errors, however nothing happens on the client. </p>
  
  <p>What did I miss?</p>
  
  <p><strong>Update 1:</strong> Based on answer from JcFx, changed the javascript above so that tHub.notify is set before calling $.connection.hub.start(). The problem remains, however.</p>
  
  <p><strong>Update 2:</strong>
  What fiddler sees:
  <img src="https://i.stack.imgur.com/wLkmO.png" alt="What the Fiddler sees"></p>
  
  <p><strong>Update 3:</strong>  When I trace into the MessageBus.Publish() call, I notice tha the Topic has no subscriptions, so the topic never gets scheduled. I'm not sure how at what point I should be checking for the subscriptiont to be made...</p>