System.Net.WebException: The underlying connection was closed: An

E

Edgar@CCrane

I have developed a web application using VB.NET 2003 under the .NET 1.1 Framework and along with that application I also included a web service which will be an entry point for a VB.NET application to update certain data in the web site. The problem that we have recently encounted is that at random times it will throw a "System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send." exception. I have read the previous postings and it seems that there is no solution for this bug at this time. Is this correct?
 
J

Jan Tielens

This problem is discussed in the following post:
http://weblogs.asp.net/jan/archive/2004/01/28/63771.aspx

It comes down to overriding the GetWebRequest method of the generated proxy
class.

protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
System.Net.HttpWebRequest webRequest =
(System.Net.HttpWebRequest) base.GetWebRequest(uri);
webRequest.KeepAlive = false;
return webRequest;
}

--
Greetz
Jan
________________
Read my weblog: http://weblogs.asp.net/jan


Edgar@CCrane said:
I have developed a web application using VB.NET 2003 under the .NET 1.1
Framework and along with that application I also included a web service
which will be an entry point for a VB.NET application to update certain data
in the web site. The problem that we have recently encounted is that at
random times it will throw a "System.Net.WebException: The underlying
connection was closed: An unexpected error occurred on a send." exception.
I have read the previous postings and it seems that there is no solution for
this bug at this time. Is this correct?
 
E

Edgardo G. Diaz

I had actually read your postings Jan, but it must of been too late in the afternoon because it did not register. This morning I transfered your function into a VB.NET function and here it is for those of you using VB

Protected Overloads Function GetWebRequest(ByVal Uri As Object)
Dim webRequest As System.Net.HttpWebRequest = MyBase.GetWebRequest(Uri)
webRequest.KeepAlive = False
Return webRequest
End Function

Thanks Jan
 
F

feroze [msft]

Can you give some more data about your application ?

Are you using authentication of some sort ?

feroze
=========
Edgar@CCrane said:
I have developed a web application using VB.NET 2003 under the .NET 1.1
Framework and along with that application I also included a web service
which will be an entry point for a VB.NET application to update certain data
in the web site. The problem that we have recently encounted is that at
random times it will throw a "System.Net.WebException: The underlying
connection was closed: An unexpected error occurred on a send." exception.
I have read the previous postings and it seems that there is no solution for
this bug at this time. Is this correct?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top