title: SignalR console app start must be called before data can be sent
body: <p>I am trying to create a client signalr app. At present, I am able to get my MVC clients to send messages to and from the Hub, however, I'm facing some difficulties with my .NET client app</p>
  
  <p>Server Hub code:</p>
  
  <pre><code>namespace ServerHub
  {
      public class ChatterBox : Hub
      {
  
          public void Send(string message)
          {
              Clients.All.addMessage(message);
          }
      }
  }
  </code></pre>
  
  <p>Console App code (almost directly lifted from github)</p>
  
  <pre><code>using Microsoft.AspNet.SignalR.Client.Hubs;
  using ServerHub;
  
  namespace ConsoleApplication1
  {
      class Program
      {
          static void Main(string[] args)
          {
            Say("hello from console");
          }
          public static void Say(string message)
          {
              //var connection = new HubConnection("http://localhost/");
  
              //IHubProxy myHub = connection.CreateHubProxy("ChatterBox");
  
              var connection = new HubConnection("http://localhost/");
              //Make proxy to hub based on hub name on server
              var myHub = connection.CreateHubProxy("ChatterBox");
              //Start connection
              connection.Start().ContinueWith(task =&gt;
              {
                  if (task.IsFaulted)
                  {
                      Console.WriteLine("Failed to start: {0}", task.Exception.GetBaseException());
                  }
                  else
                  {
                      Console.WriteLine("Success! Connected with client connection id {0}", connection.ConnectionId);
                      // Do more stuff here
                  }
              });
  
              connection.Send("Hello").ContinueWith(task =&gt;
              {
                  if (task.IsFaulted)
                  {
                      Console.WriteLine("Send failed {0}", task.Exception.GetBaseException());
                  }
                  else
                  {
                      Console.WriteLine("Success");
                  }
              });
          }
      }
  }
  </code></pre>
  
  <p>I get the error message below, during <code>connection.Send()</code></p>
  
  <blockquote>
    <p>Start must be called before data can be sent.</p>
  </blockquote>
  
  <p>Where did I go wrong?</p>
  
  <p>EDIT:</p>
  
  <p>2nd attempt:</p>
  
  <pre><code>    var connection = new HubConnection("http://localhost/");
      //Make proxy to hub based on hub name on server
      var myHub = connection.CreateHubProxy("ChatterBox");
      //Start connection
      connection.Start().ContinueWith(task =&gt;
          {
              if (task.IsFaulted)
              {
                  Console.WriteLine("Failed to start: {0}", task.Exception.GetBaseException());
              }
              else
              {
                  Console.WriteLine("Success! Connected with client connection id {0}",
                                    connection.ConnectionId);
  
                  // Do more stuff here
  
                  connection.Send("Hello");
              }
          });
  
  
      myHub.Invoke("Send", "lol");
  </code></pre>
  
  <p>Still gives me an error</p>
  
  <p>EDIT: 3rd Attempt</p>
  
  <pre><code>            var connection = new HubConnection("http://localhost:60610/");
              //Make proxy to hub based on hub name on server
              var myHub = connection.CreateHubProxy("ChatterBox");
              //Start connection
              connection.Start().ContinueWith(task =&gt;
              {
                  if (task.IsFaulted)
                  {
                      Console.WriteLine("Failed to start: {0}", task.Exception.GetBaseException());
                  }
                  else
                  {
                      //Console.WriteLine("Success! Connected with client connection id {0}", connection.ConnectionId);
  
                      myHub.Invoke("Send", "lol");
                  }
              });
  </code></pre>
  
  <p>Seems to be working</p>
  
  <p>I also needed to set the port number - e.g., if I'm browsing my MVC website like this: <code>http://localhost:60610/</code>, this is the address I need to set in my console app. </p>
  
  <p>Can I say that during deployment, it won't be an issue because it'll be port 80 by default?</p>