title: Sharepoint Client model - request timeout
body: <p>I am receiving a timeout from the Sharepoint Client Managed Object model.</p>
  
  <pre><code>Microsoft.SharePoint.Client.ServerException: The operation has timed out.
  </code></pre>
  
  <p>Basically, I am batching 100 updates and sending them at one go. It is no problem for me if takes time but I really want to avoid timeout exception.</p>
  
  <p>I have tried in a million of ways to increase the timeout in the client context but they were all without success. I have used reflection to try to identity what the sharepoint is doing when calling the executequery method of the client context. sharepoint is basically creating an HttpWebRequest and sending it.</p>
  
  <p>I have ended with the below code, but still without success:</p>
  
  <pre><code> public static void SetInfinteTimeout(this ClientContext ctx)
  {
      int timeout = 10 * 60 * 1000;
      ctx.RequestTimeout = timeout;
      ctx.PendingRequest.RequestExecutor.RequestKeepAlive = false;            
      ctx.PendingRequest.RequestExecutor.WebRequest.KeepAlive = false;
      ctx.PendingRequest.RequestExecutor.WebRequest.Timeout = timeout;
      ctx.PendingRequest.RequestExecutor.WebRequest.ReadWriteTimeout = timeout;            
      System.Net.ServicePointManager.DefaultConnectionLimit = 200;
      System.Net.ServicePointManager.MaxServicePointIdleTime = 2000;
      System.Net.ServicePointManager.MaxServicePoints = 1000;
      System.Net.ServicePointManager.SetTcpKeepAlive(false, 0, 0); 
      ServicePointManager.DnsRefreshTimeout = timeout; // 10 minutes       
  
  }
  </code></pre>
  
  <p>But I am still receiving a timeout error! 
  <br/>Is there anything else that I am missing please?</p>
  
  <p><br/>Any assistance would be greatly appreciated.</p>