Hello all,
I'm having such a basic problem with asynchronous
remoting that I'm sure I'm just missing something
obvious.
My client application makes an asynchronous call to
a remoted object using the BeginInvoke/EndInvoke
delegate methods. Now if there is an exception on
the server side, the client gets to handle that when
it calls EndInvoke. E.g., if the server makes a call
to an SQL database which fails with an SqlException,
the client sees the SqlException just fine. No
problem.
However, if the remote call fails due to a transport
level problem, then the client gets no chance to
handle the exception. E.g., I'm hosting my remote
server in IIS using Digest authentication. If the
authentication fails, the remote call in the
client generates a WebException, but that exception
appears to be thrown in the thread pool thread that
is making the remote call. If I run the client under
the de*, I get the system unhandled exception
dialog. If I run the client stand-alone, the exception
simply kills the thread making the remote call, and
the call never completes.
So, how can I handle transport level exceptions in
the client code while doing an asynchronous remote
call? This is such a basic issue that there must be
a simple way to do it.
Thanks,
Sami