title: WP8 SignalR client hangs when connecting
body: <p>I am using the example at <a href="http://www.asp.net/signalr/overview/signalr-20/getting-started-with-signalr-20/tutorial-getting-started-with-signalr-20" rel="nofollow">http://www.asp.net/signalr/overview/signalr-20/getting-started-with-signalr-20/tutorial-getting-started-with-signalr-20</a> for my hub. For my clients I am using a PCL which targets Xamarin.Android and WP8 (Profile158) and have added the SignalR .NET Client from Nuget.</p>
  
  <p>I then reference the PCL from a Xamarin.Android and a WP8 project.</p>
  
  <p>They both simply send and receive chat messages as per the example.</p>
  
  <p>The web client that is part of the server hub project and the Xamarin.Android app both work fine. However the WP8 app hangs at <code>hubConnection.Start().Wait()</code>.</p>
  
  <p>All the clients and the hub are on the same WiFi network and both the phones can access the web page client.</p>
  
  <p>I am using version 2.0.0.0 of the SignalR server and .NET client.</p>
  
  <p>The PCL client used by both device clients uses the following code:</p>
  
  <pre><code>public class ChatClient
  {
      private IHubProxy _chatHubProxy = null;
  
      public string Connect(Action&lt;string, string&gt; chatCallback)
      {
          var hubConnection = new HubConnection("http://192.168.0.4/SignalRSpike");
          hubConnection.Error += hubConnection_Error;
          hubConnection.Headers.Add("Id", "1");
  
          _chatHubProxy = hubConnection.CreateHubProxy("ChatHub");
          _chatHubProxy.On&lt;string, string&gt;("broadcastMessage", chatCallback);
          hubConnection.Start().Wait();
          return hubConnection.Transport.Name;
      }
  
      void hubConnection_Error(Exception ex)
      {
          Debug.WriteLine("Hub error: " + ex.ToString());
      }
  
      public async void SendMessage(string name, string message)
      {
          var result = await _chatHubProxy.Invoke&lt;bool&gt;("Send", name, message);
          Debug.WriteLine("Result of send: " + result);
      }
  }
  </code></pre>
  
  <p>The hub code is:</p>
  
  <pre><code>public class ChatHub : Hub
  {
  
      public async Task&lt;bool&gt; Send(string name, string message)
      {
          // Call the broadcastMessage method to update clients.
          await Clients.All.broadcastMessage(name, message);
          return true;
      }
  }
  </code></pre>
  
  <p>The Output Debug window shows</p>
  
  <pre><code>'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'Anonymously Hosted DynamicMethods Assembly'. 
  'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\Data\Programs\{34D909A2-97D5-4735-85F6-4B735F6C6769}\Install\System.Net.Http.DLL'. Cannot find or open the PDB file.
  'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Threading.Tasks.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
  'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\Data\Programs\{34D909A2-97D5-4735-85F6-4B735F6C6769}\Install\System.Net.Http.Primitives.DLL'. Cannot find or open the PDB file.
  'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\Data\Programs\{34D909A2-97D5-4735-85F6-4B735F6C6769}\Install\System.Net.Http.Extensions.DLL'. Cannot find or open the PDB file.
  The thread 0x2b3c has exited with code 259 (0x103).
  The thread 0x32a0 has exited with code 259 (0x103).
  The thread 0x1f80 has exited with code 259 (0x103).
  </code></pre>
  
  <p>And as the app is hanging a new <code>thread x has exited</code> appears every minute or so.</p>
  
  <p><strong>Update 1</strong></p>
  
  <p>I am using IIS and the app pool is Integrated.</p>
  
  <p>I have also copied the client code from the PCL into the WP8 app so that there is no longer a dependency on the PCL assembly, but the result is exactly the same.</p>