Thanks :http://support.microsoft.com/kb/915599
When you try to make an HTTP request in an application that is built on the .NET Framework, you may receive one or more of the following error messages:
When you try to make an HTTP request in an application that is built on the .NET Framework, you may receive one or more of the following error messages:
Error message
The underlying connection was closed: An unexpected error occurred on a send.
Error message
This problem occurs when the client computer cannot send an HTTP request. The client computer cannot send the HTTP request because the connection has been closed or is unavailable. This problem may occur when the client computer is sending lots of data. To resolve this problem, see resolutions A, D, E, F, and O.Resolution A
To resolve this problem, make sure that you are using the most recent version of the .NET Framework. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
318785
(http://support.microsoft.com/kb/318785/ )
How to determine which versions of the .NET Framework are installed and whether service packs have been applied Resolution D
To resolve this problem, disable the keep-alive feature. In the .NET Framework, set the HttpWebRequest.KeepAlive property to FALSE. To do this when you call a Web service, follow these steps.
Note The keep-alive feature is required for NTLM authentication.
Note The keep-alive feature is required for NTLM authentication.
- Create a new class by inheriting from the generated proxy class.
- Add a method to the class to override the GetWebRequest method. This change lets you access the HttpWebRequest object. If you are using Microsoft Visual C#, the new method must be similar to the following.
class MyTestService:TestService.TestService { protected override WebRequest GetWebRequest(Uri uri) { HttpWebRequest webRequest = (HttpWebRequest) base.GetWebRequest(uri); //Setting KeepAlive to false webRequest.KeepAlive = false; return webRequest; } }
Class MyTestService Inherits TestService.TestService Protected Overrides Function GetWebRequest(ByVal uri As Uri) As System.Net.WebRequest Dim webRequest As System.Net.HttpWebRequest webRequest = CType(MyBase.GetWebRequest(uri), System.Net.HttpWebRequest) 'Setting KeepAlive to false webRequest.KeepAlive = False GetWebRequest = webRequest End Function End Class
Resolution E
To resolve this problem, set the ServicePointManager.MaxServicePointIdleTime property to less than the time-out value of the server keep-alive connection.
Notes
- When a ServicePoint object has been idle for the time that is specified in the MaxIdleTime property, it is eligible for garbage collection.
- Make sure that the ServicePointManager.MaxServicePointIdleTime property is set before any HTTP requests are made. For more information about the ServicePointManager.MaxSercvePointIdleTime property, visit the following Microsoft Web site:
http://msdn2.microsoft.com/en-us/library/system.net.servicepointmanager.maxservicepointidletime(vs.71).aspx
(http://msdn2.microsoft.com/en-us/library/system.net.servicepointmanager.maxservicepointidletime(vs.71).aspx)
Resolution F
To resolve this problem, increase the time-out value on the server computer and on other network devices. To increase the time-out value in Microsoft Internet Information Services (IIS) 6.0, follow these steps:
- Click Start, click Control Panel, click Administrative Tools, and then click Internet Information Services (IIS) Manager.
- Click the name of the computer that you want to reconfigure, and then click Web Sites.
- Right-click the Web site that you want to reconfigure, and then click Properties.
- Type a new value in the Connection timeout box, and then click OK.
- On the File menu, click Exit.
Resolution O
To resolve this problem, make sure that the client computer does not send the HTTP 100-Continue header. Additionally, make sure that the client computer does not expect to receive the HTTP 100-Continue header.
Note This resolution is effective if the Web server or the proxy server does not support the HTTP 100-Continue header. For more information about how to disable the HTTP 100-Continue header for the client computer, visit the following Microsoft Web site:
Comments
Post a Comment