title: Exception when trying to use an existing instance of HttpClient in C#
body: <blockquote>
    <p>Update- The below issue was solved by setting the proxy for
    HttpClientHandler. But I still wonder how the first request succeeded
    without setting the proxy ever? Why would only subsequent
    requests(after the first request) would fail because of proxy?</p>
  </blockquote>
  
  <p>I have a simple class to reuse a single instance of "HttpClient" across different requests. The issue I am facing is that only the first call succeeds, while all the subsequent call fails with a SocketException.</p>
  
  <pre><code>public class MyHttpClient
   {
      private static readonly HttpClient client;
      static MyHttpClient()
      {
          client = new HttpClient();
          client.BaseAddress = new Uri("http://x.com");
      }
      public async Task&lt;string&gt; GetSecurityToken(LoginData data)
      {
          var reqMsg = JsonConvert.SerializeObject(data);
          var reqContent = new StringContent(reqMsg, System.Text.Encoding.UTF8, "application/json");
          var response= await client.PostAsync("/api/v1/security/token", reqContent)
          var result = await response.Content.ReadAsStringAsync();
          return result
      }
   }
  
  
  // The above class is consumed as
  
          var client = new MyHttpClient();
          var login = new LoginData("abc@gmail.com", "xxxx");
          var result = await client.GetSecurityToken(login); // this call succeeds !
          var result1 = await client.GetSecurityToken(login); // this call fails with an exception, but why?
  </code></pre>
  
  <blockquote>
    <p>The exception I get in second call is - SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond</p>
  </blockquote>