title: SignalR self host connection issue
body: <p>I recently created a proof of concept console application using SignalR (self host). It worked a treat for our use. The client connected fine and I was able to send updates from the server to the client. Lovely!</p>
  
  <p>I've now transferred the code from the Console application to a winforms application for a prettier UI. Now that same client won't connect to the server yet it will still connect to the old Console version.</p>
  
  <p>Winforms code:</p>
  
  <pre><code>string url = "http://localhost:8080";
              using (WebApp.Start(url))
              {
                  // Let the app know the server is up
              }
  </code></pre>
  
  <p>Console code:</p>
  
  <pre><code>string url = "http://localhost:8080";
              using (WebApp.Start(url))
              {
                  Console.WriteLine("Server running on {0}", url);
                  Console.ReadLine();
              }
  </code></pre>
  
  <p>Client connection code:</p>
  
  <pre><code>if (!connected)
                  {
                      int i = 0;
  
                      // Try 3 times
                      while (i &lt;= 2)
                      {
                          try
                          {
                              string server = Properties.Settings.Default.Server + ":" + Properties.Settings.Default.PortNumber.ToString();
                              connection = new HubConnection(server);
                              connection.StateChanged += connection_StateChanged;
  
                              hub = connection.CreateHubProxy("MyHub");
                              connection.Start().Wait();
  
                              hub.On&lt;string&gt;("addMessage", param =&gt; { UpdateAlarmStatus(param); });
                              return true;
                          }
                          catch (Exception)
                          {
                              i++;
                          }
                      }
                      return false;
                  }
                  else
                  {
                      return true;
                  }
  </code></pre>
  
  <p>The error the client is reporting is:
  Exception:Thrown: "No connection could be made because the target machine actively refused it" (System.Net.Sockets.SocketException)
  A System.Net.Sockets.SocketException was thrown: "No connection could be made because the target machine actively refused it"
  Time: 25/01/2015 15:09:23
  Thread:Worker Thread[8232]</p>
  
  <p>Why would the target machine (localhost) refuse itself which the Console version doesn't? I've been looking at the code over and over and I cannot see where I'm going wrong. Can anyone point me in the right direction please?</p>
  
  <p>Thank you for reading.
  Paul.</p>