HighTechTalks DotNet Forums  

What happens to an exception thrown in asyncronous call.

Dotnet Framework (Remoting) microsoft.public.dotnet.framework.remoting


Discuss What happens to an exception thrown in asyncronous call. in the Dotnet Framework (Remoting) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Douglas Peterson
 
Posts: n/a

Default What happens to an exception thrown in asyncronous call. - 09-26-2006 , 07:38 PM






So I have this (singleton) remote object. It has a delegate for a data
change event:
public delegate void DataChangeEvent();

When the client(s) connect to the object, they add themselves as listeners
to the event:
remoteObject.dataChangeListeners += new DataChangeEvent(some function);

When dispatching the event I have the object do the following:
if (dataChangeListeners != null)
foreach (DataChangeEvent dce in dataChangeListeners.GetInvocationList())
dce.BeginInvoke(null, null);

I did it in this way because a) I don't care if this notice is received by
the clients or not, and b) I want the object to continue going about its
business, not waiting around to find out if the call completed or not.

Then I wondered: What happens if an exception is thrown by the client code
while processing the event call? I'm not clear about how asyncronous calls
are made in the framework, let alone asyncronous calls made across a TCP
connection.

So I tried it out and.. nothing happens. No exception seems to go unhandled
anywhere. There's no trace output in the debugger, no dialog boxes pop up,
no notice of threads terminating, nothing; but the code after the throw does
not execute (i.e. it IS getting thrown). I don't have any exception handlers
anywhere (client or server) that silently trap an exception.

So where is this exception going? Who's handling it? Who's supposed to
handle it?



Reply With Quote
  #2  
Old   
Spam Catcher
 
Posts: n/a

Default Re: What happens to an exception thrown in asyncronous call. - 09-27-2006 , 01:29 PM






"Douglas Peterson" <Tergiver (AT) nospam (DOT) msn.com> wrote in news:upkVvTc4GHA.1200
@TK2MSFTNGP02.phx.gbl:

Quote:
So where is this exception going? Who's handling it? Who's supposed to
handle it?
The exception is raised in the callback handler - so in your case, you need
to assign a callback handler to the async call


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.