Aynchronous web services connection end in Close_Wait state

T

tom

Hi all, I hope I can explain my problem clearly.

I have a .NET c# windows application calling a localhost web service
using
asynchronous callback.

While still waiting for the result, the user decides to end the
application,
my application then cast the applicable IAsyncResult to a
WebClientAsyncResult object and call the Abort() method of the latter
object.

Everything is fine, however, it left the server side with the
Close_Wait
connection state. (Under TCP term, it means the server still waiting
for the
ACK from the client). How can I make sure the .NET window application
will
send the ACK after calling the above Abort()?

I am using XP Pro, the IIS only allows max. 10 connections, the
Close_Wait
state connection will be kept opened for a very long time.

I have searched intensively but I can not find a solution. Hope someone
out
there can help!

Rgs
Tom
 
D

Dan Rogers

Hi Tom,

When the client abandons the connection, the server has no way to know.
The thread on the server will either time out (if it takes too long to
process the request, or detect that the connection is closed once it tries
to write on the response stream. This is the nature of HTTP.

You may be able to test on Windows XP pro, but it is inadvisable to
consider running a service on the limited connection pool. Connection
limits will severely hamper an HTTP server that is taking longer than
sub-second to respond. The best thing I can advise you to do is make your
service respond in a timely manner if you absolutely have to deal with
connection limits. With rapid response, your client programs won't have to
deal with canceling (abandoning) a request connection.

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
 
T

tom

Thanks Don,

thanks for the solution! I created web services to monitor certain
condition changes on a database and call back the client with the
changes. Sometimes there will be nochanges for hours.

I reprogrammed the web services to reply in every 10 seconds even no
changes and the problems solved.

Brilliant!

Tom
 
T

tom

Thanks Don,

thanks for the solution! I created web services to monitor certain
condition changes on a database and call back the client with the
changes. Sometimes there will be no changes for hours.

I reprogrammed the web services to reply in every 10 seconds even no
changes and the problems solved.

Brilliant!

Tom
 
T

tom

Thanks Don,

thanks for the solution! I created web services to monitor certain
condition changes on a database and call back the client with the
changes. Sometimes there will be no changes for hours.

I reprogrammed the web services to reply in every 10 seconds even no
changes and the problems solved.

Brilliant!

Tom
 
T

tom

Thanks Don,

thanks for the solution! I created web services to monitor certain
condition changes on a database and call back the client with the
changes. Sometimes there will be no changes for hours.

I reprogrammed the web services to reply in every 10 seconds even no
changes and the problems solved.

Brilliant!

Tom
 

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

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top