title: Timeout using ServiceStack.Client
body: <p>I have been using service stack via AJAX calls for some time without issue, but have recently created a quick winforms app which utilizes the service stack client (specifically JsonServiceClient).</p>
  
  <p>However - I have hit a problem whereby I consistently get a timeout on a call which works successfully on the the first TWO attempts.  It looks like either the service stack client is holding on to some resource, or I am using the client in the wrong way.  It only occurs when running against a remote service (works every time on a local machine).  Here is my code, and the exception:</p>
  
  <pre><code>        var url = "http://www.TestServer.com/api";
          var taskId = Guid.Parse("30fed418-214b-e411-80c1-22000a5b9fe5");
          var email = "admin@example.com";
  
          using (var client = new JsonServiceClient(url))
          {
              var result = client.Send(new Authenticate {UserName = "username", Password = "Password01", RememberMe = true});
              client.Put(new AssignTask { AdminTaskId = taskId, Assignee = email });//Call #1 - works fine
              client.Put(new AssignTask { AdminTaskId = taskId, Assignee = email });//Call #2 - works fine
  
              try
              {
                  client.Put(new AssignTask { AdminTaskId = taskId, Assignee = email });//Call #3 - works fine
              }
              catch (WebException ex)
              {
                  //Times out every time
                 //at System.Net.HttpWebRequest.GetRequestStream(TransportContext&amp; context)
                 //at System.Net.HttpWebRequest.GetRequestStream()
                 //at ServiceStack.Net40PclExport.GetRequestStream(WebRequest webRequest)
                 //at ServiceStack.ServiceClientBase.&lt;&gt;c__DisplayClassa.&lt;SendRequest&gt;b__9(HttpWebRequest client)
                 //at ServiceStack.ServiceClientBase.PrepareWebRequest(String httpMethod, String requestUri, Object request, Action`1 sendRequestAction)
                 //at ServiceStack.ServiceClientBase.SendRequest(String httpMethod, String requestUri, Object request)
                 //at ServiceStack.ServiceClientBase.Send[TResponse](String httpMethod, String relativeOrAbsoluteUrl, Object request)
                 //at ServiceStack.ServiceClientBase.Put[TResponse](String relativeOrAbsoluteUrl, Object requestDto)
                 //at ServiceStack.ServiceClientBase.Put(Object requestDto)
                 //at SSClientIssue.Program.Main(String[] args) in c:\Users\David\Documents\Visual Studio 2013\Projects\SSClientIssue\SSClientIssue\Program.cs:line 27
                  throw;
              }
  
          }
  </code></pre>
  
  <p>After the timeout, I can close and reload the app (server stays up), and then get same behavior again (two successful calls).  IIS logs show that the 3rd call does not make it to the server, so looks like a Client issue.</p>
  
  <p>I have been looking at this for 8 hours and I think my eyes are starting to bleed...If anyone can help I will buy you a beer!</p>