title: HttpWebRequest Issue: System lacked sufficient buffer space or because a queue was full
body: <p>I am using a service to pull in a list of hotels in the form of an XML document. All of this works fine on our dev server when testing it, however shorty after deploying it live all the pages using this are broken and are displaying this error:</p>
  
  <pre><code>An operation on a socket could not be performed because the system lacked
  sufficient buffer space or because a queue was full 91.103.175.187:80
  
  Description: An unhandled exception occurred during the execution of the current
  web request. Please review the stack trace for more information about the error
  and where it originated in the code. 
  
  Exception Details: System.Net.Sockets.SocketException: An operation on a socket
  could not be performed because the system lacked sufficient buffer space or
  because a queue was full 91.103.175.187:80
  
  Stack Trace: 
  
  [SocketException (0x2747): An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full 91.103.175.187:80]
     System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +305
     System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket&amp; socket, IPAddress&amp; address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception&amp; exception) +699
  
  [WebException: Unable to connect to the remote server]
  System.Net.HttpWebRequest.GetResponse() +7859156
  Laterooms.Gateway.LateroomsGateway.GetHotelsWithurl(String url)
  Laterooms.Gateway.LateroomsGateway.GetHotelsByKeyword(String keyword, String orderBy) 
  Laterooms.LateroomsManager.GetHotelsByKeyword(String keyword, String orderBy, String lang)
  </code></pre>
  
  <hr>
  
  <p>After seeing this I thought it maybe due to the amount of requests being made so I implemented caching but still the same issues are occurring. Here is the code I am using to pull in the data:</p>
  
  <pre><code>    HttpWebRequest request = null;
  
      Uri uri = new Uri(url);
      request = (HttpWebRequest)WebRequest.Create(uri);
      request.Method = "POST";
      request.AllowWriteStreamBuffering = false;
      request.ContentLength = 0;
      request.KeepAlive = false;
  
      using (WebResponse response = request.GetResponse())
      {
          using (Stream dataStream = response.GetResponseStream())
          {
              _LateroomsXml.Load(dataStream);
          }
      }
  </code></pre>
  
  <p>Again this issue only occurs on on our live server. After many hours of debugging and googling I have not come any closer to solving this issue.</p>
  
  <p>Any help on this would be greatly appreciated!</p>