我正在使用服務以XML文檔的形式提取酒店列表。所有這一切都在部署使用這種被打破過的所有網頁後進行測試時它,但是矮子並顯示該錯誤的原理我們的開發服務器上的罰款:HttpWebRequest問題:系統缺少足夠的緩衝區空間或隊列已滿
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& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& 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)
看到這個之後,我認爲這可能是由於到所要求的數量,所以我實現了緩存但仍然發生相同的問題。這裏是我用來拉入數據的代碼:
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);
}
}
此問題只發生在我們的在線服務器上。經過幾個小時的調試和谷歌搜尋,我還沒有接近解決這個問題。
任何幫助,將不勝感激!
什麼虛擬內存分配給活箱 - 我曾經有一個非常類似的問題,一旦虛擬內存不足造成的,即使服務器本身有足夠的標準內存 – Johnv2020
它有4GB分配給它,現在它只運行在2GB 。我認爲這可能也是問題,但似乎並非如此。 – shoughton123
[「無法執行套接字上的操作,因爲系統缺少足夠的緩衝區空間或者因爲隊列已滿」](http://stackoverflow.com/questions/4415175/an-operation-on-a -socket-could-be-performing-because-the-system-lacked-suffi) – Ash