Keep-Alive Connections...

Discussion in 'ASP .Net Web Services' started by Paul Colton, Nov 10, 2003.

  1. Paul Colton

    Paul Colton Guest

    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
    Paul Colton, Nov 10, 2003
    #1
    1. Advertising

  2. Paul Colton

    MSFT Guest

    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.)
    MSFT, Nov 11, 2003
    #2
    1. Advertising

  3. Paul Colton

    Paul Colton Guest

    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?

    "MSFT" <> wrote in message
    news:...
    > 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.)
    >
    Paul Colton, Nov 11, 2003
    #3
  4. Paul Colton

    MSFT Guest

    MSFT, Nov 13, 2003
    #4
  5. 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




    "Paul Colton" <paul@nospam_colton.net> wrote in message
    news:#...
    > 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?
    >
    > "MSFT" <> wrote in message
    > news:...
    > > 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.)
    > >

    >
    >
    Feroze [MSFT], Dec 17, 2003
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luiz Alberto Gibson da Costa

    web chat development, http header connection: keep-alive

    Luiz Alberto Gibson da Costa, Aug 6, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    604
    Luiz Alberto Gibson da Costa
    Aug 6, 2003
  2. twscott
    Replies:
    1
    Views:
    5,038
  3. Herman

    Keep JVM alive with JNI

    Herman, May 24, 2004, in forum: Java
    Replies:
    6
    Views:
    1,105
    Herman
    May 27, 2004
  4. Vincent van Scherpenseel

    Problems with keep-alive connections

    Vincent van Scherpenseel, May 30, 2004, in forum: Perl Misc
    Replies:
    1
    Views:
    133
    Ben Morrow
    May 30, 2004
  5. hisan
    Replies:
    1
    Views:
    1,311
    Dan Stromberg
    Jun 25, 2012
Loading...

Share This Page