Keep-Alive Connections...

P

Paul Colton

It seems that by default, Web Services connections are kept alive (i.e.
Keep-Alive header). when a connection is kept open, if the backend web
server hosting the web service suddenly goes down, my (winforms) app will
throw a low level socket exception.

Is there a graceful way to handle web server/service sudden disconnects?

Regards,
Paul Colton
 
M

MSFT

Hi Paul,

I think you may use A Try..Catch statement with your Web service calling
code. If the server was down or the connection is broken, you can catch the
exception and handle it by custom code.


Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
P

Paul Colton

Apparently not. It is a very low level (i.e. non-managed code) socket
exception which cannot be caught using try/catch. I can set up an
UnhandledExceptionEventHandler, but this takes me out of the context of my
web service call. Is there another solution?
 
F

Feroze [MSFT]

What do you mean by "Low level socket exception" ? Even if there is an
unmanaged error condition, it should be thrown up the chain, and caught
either by the underlying system.net code, or bubbled up to the app.

can you tell exactly what exception you are getting ?

Generally speaking, network failures can happen at anytime. While the
underlying networking code in the framework does a best effort job to
recover, there might be situations where it cant. In such cases, exceptions
will be thrown to the app, and it is expected that the app will handle them
in any manner it choses.


--
Remove "user" from the email address to reply to the author.

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

Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 

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,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top