title: Avoid - An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full
body: <p>I get following error from an Azure Function App when using cosmos DB. I have got the same with HttpClient but seemed to solve that by doing HttpClient static. Can you solve the same problem just by making the CosmosDB client static? Something like:</p>
  <pre><code>public class DocRepoCoach
  {
      public string ConnStr { get; set; }
  
      public Container XX1Container { get; set; }
      public Container XX2Container { get; set; }
      **public static CosmosClient Client { get; set; }**
  
      public DocRepoCoach(string connectionString)
      {
          ConnStr = connectionString;
          var options = new CosmosClientOptions() { AllowBulkExecution = true, MaxRetryAttemptsOnRateLimitedRequests = 1000 };
          Client = new CosmosClient(ConnStr, options);
          XX1Container = Client.GetContainer(&quot;XXXAPI&quot;, &quot;XX&quot;);
          XX2Container = Client.GetContainer(&quot;XXXAPI&quot;, &quot;XX&quot;);
      }
  }
  </code></pre>