471,316 Members | 1,543 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,316 software developers and data experts.

underlying connection has closed

I am consuming continously my own web-services on a localhost client with a
rate of perhaps 35 request/response-pairs a minute.
I am using "invoke-id=1", so there is at the same time only one request
After a runtime of 4 days I get the system.net.exception "The underlying
connection was closed: An unexpected error occured on a send"
Subsequent ws-calls in this state result also in the same exception,
browsing a local hosted html-file results in HTTP-error 504.
After a restart of windows all goes well (for the next 4 days).
I read some knowledgebase articles (826210,...) about this behaviour and
tried the webRequest-properties KeppAlive=false and
ProtocolVersion = HttpVersion.Version10 - but no success.
client, server = Win2003server, sp2; Net 2.0

It's a simple HTTP-Web_service, I don't use HTTPS and WSE, the IIS-settings
are the default.

What is the reason for this problem/bug?
What's a stable solution with no performance drawback for a production
When does MS solve this bug finally?

best regards
Jun 25 '07 #1
2 2134
Hi Friedhelm,

From your description, when consuming an ASP.NET standard webservice hosted
in IIS server, the client will periodically get 504(underlying connection
was closed...) error ,correct?

As you said that you'll get the problem after a runtime of 4 days, do you
mean when the problem occur, the webserver will stop responding or it just
break those requests send at that time but continue work well after that
point? For such "underlying connection closed..." issue, it is mostly
caused by something at server-side or intermediate connection(such as proxy
server ....) and the KB article you mentioned (826210) just mentioned one
of the possible cause, it is due to the server-side ASP.NET application's
web.config execution timeout value is not long enough that make the
webrequest timeout(and close the connection). However, for your scenario,
I think we still need to further track down the issue. Here are some
possible problems I can get and the things you can check:

** Since ASP.NET use threadpool threads to process coming requests, when
thread pool threads are exhausted, it will stop processing new requests
and cause problem. Is your webservice method call long run or will it be
blocked by some certain resource?

** It is also possible that some unhandled exception occured at server-side
that cause application restart will make the service unavailable for some
time and you'll also receive error at that time.

Things to check include the server-side eventlog to see whether ASP.NET
process has ever recycled or you can add code to trace whether the
application will restart periodically. In addition, there are some
performance counters for ASP.NET applications(such as Requests timeout/sec
, requests reject/sec, ......), you can lookup those counters and track the
change and trends during the period when the problem will occur.

If there is any further finding, please feel free to post here.


Steven Cheng

Microsoft MSDN Online Support Lead


Get notification to my posts through email? Please refer to

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at

This posting is provided "AS IS" with no warranties, and confers no rights.

Jun 26 '07 #2
Thanks for your reply friedhelm,

Sorry for the delay reply as I was absent due to some urgent issue previous
days. As for the "execution timeout" it is an ASP.NET runtime setting and
it is only a possible cause of such behavior, but for your scenario, it is
not likely due to this since you didn't always get this problem(but
ocassionally after certain period of time).

So far, I think currently you'e better try getting some further information
from the server application and if possible, english one would be
prefereed. In addition, due to the complexity of troubleshooting on such
issue which may be hard to deal with in newsgroup, if this is an urgent
issue, I suggest you contact CSS for further continous assistance.



Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Jul 2 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

26 posts views Thread by Rajeev Tipnis | last post: by
3 posts views Thread by MattM | last post: by
4 posts views Thread by =?Utf-8?B?QXJuYXVkIFZpc2N1c2k=?= | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.