title: SignalR stops after negotiate, doesn't ping, connect or make any long polling XHR requests
body: <p>I am using SignalR 1.1.2 with SQL as backplane, and frequently (like 70% of page loads), SignalR fires of negotiate request which suceedes (doesn't fail) and just halts and nothing happens anymore. I found out that there is some conflict with jquery.validation.js
  so I updated: jquery, jquery validation and jquery unobtrusive ajax to latest available versions, but it still happens,,</p>
  
  <p>Other times when it works correctly I can see few XHR requests made:</p>
  
  <ul>
  <li><p>negotiate</p></li>
  <li><p>connect</p></li>
  <li><p>ping</p></li>
  <li><p>long polling requests further on</p></li>
  </ul>
  
  <p>Here is my hub:</p>
  
  <pre><code>public class NotificationsHub : Hub
  {
      public override Task OnConnected()
      {
         Groups.Add(Context.ConnectionId, CurrentUser.UserId.ToString());
         return base.OnConnected();
      }
  
      public override Task OnDisconnected()
      {
          Groups.Remove(Context.ConnectionId, CurrentUser.UserId.ToString());
          return base.OnDisconnected();
      }
     }
  </code></pre>
  
  <p>And my client code:</p>
  
  <pre><code>$(document).ready(function () {
      var nh = $.connection.notificationsHub;
      nh.notify = function (notificationHtml) {
          $('#notification-box').find('ul').prepend(notificationHtml);
          $('#notification-bubble').text($('#notification-bubble').text() + 1);
      };
  
      $.connection.hub.start();
  });
  </code></pre>
  
  <p>While refreshing page I get error:</p>
  
  <pre><code>The connection to http://localhost:55087/signalr/connect?transport=serverSentEvents&amp;connectionToken=FuqvvQJaxyCfy0dj2DEoZQFkBmthBk9LxU6ZEGZO4ypbSy8pUpzrvCKWTjykxp9E9GtMdwLI0sX_tWkvK1XfJaEtjFHOL3Qmeg2eILh4pTZnEzXDyq6KPuvPw_4kzj9VtNe89YsWW-3sstPwu_I60A2&amp;connectionData=%5B%5D&amp;tid=4 was interrupted while the page was loading.
  </code></pre>
  
  <p>And then following POST request which succedes:</p>
  
  <pre><code>http://localhost:55087/signalr/abort?transport=serverSentEvents&amp;connectionToken=FuqvvQJaxyCfy0dj2DEoZQFkBmthBk9LxU6ZEGZO4ypbSy8pUpzrvCKWTjykxp9E9GtMdwLI0sX_tWkvK1XfJaEtjFHOL3Qmeg2eILh4pTZnEzXDyq6KPuvPw_4kzj9VtNe89YsWW-3sstPwu_I60A2
  </code></pre>
  
  <p><strong>Here is a quick fix, but I would like to know is this a bug or normal behaviour of SignalR:</strong></p>
  
  <p><a href="https://stackoverflow.com/questions/15782281/signalr-event-becomes-intermittent-when-deployed-to-a-server">SignalR event becomes intermittent when deployed to a server</a></p>
  
  <p><strong>Update 2:</strong></p>
  
  <p>Fix from above worked but long poll XHR requests lasted for few minutes, which seemed odd to me and client side was updated after few minutes when request compleated which isn't acceptable, so I decided to upgrade SignalR to 2.0.0 beta2.</p>
  
  <p>After that first time I was running applications SignalR couldn't connect(timeout after second or so)..
  Second time everything worked fine, long poll XHR were completing in 2 sec tops.
  <strong>Third time back to step one, no ping, no connnect, no long poll requests. BUT when something is triggered from server side it get's updated immedietly like it is connected through websockets.. and only thing I can see in debug window is:</strong></p>
  
  <p>[00:12:52 GMT+0200 (Central European Standard Time)] SignalR: Triggering client hub event 'notify' on hub 'NotificationsHub'.</p>
  
  <p>Here are my changes to Hub which work with SignalR 2.0.0 beta2</p>
  
  <pre><code> public class NotificationsHub : Hub
      {
           public async override Task OnConnected()
           {
               var user = WebSecurity.GetUserId(Context.User.Identity.Name);
               Groups.Add(Context.ConnectionId, user.ToString());
               await base.OnConnected();
           }
  
          // OnDisconnected() was dropped thanks to N. Taylor Mullen
      }
  </code></pre>
  
  <p>Client side:</p>
  
  <pre><code>$(document).ready(function () {
      $.connection.notificationsHub.client.notify = function (notificationHtml) {
          $('#notification-box').find('ul').prepend(notificationHtml);
          $('#notification-bubble').text(parseInt($('#notification-bubble').text()) + 1);
      };
  
      $.connection.hub.logging = true; // optional, if you want to see what's going on 
      $.connection.hub.start();
  });
  </code></pre>