PC Review


Reply
Thread Tools Rate Thread

Behavior of events when one event handler triggers an exception

 
 
gs_sarge@yahoo.com
Guest
Posts: n/a
 
      30th Jan 2004
Hi:

I'm trying to figure out the behavior of an event when one of the
event handlers triggers an exception.

In my case, I'm using events so the server can contact the client
using Remoting.

Each client registers its own event handler for the servers event.

Hower, if one of the client connections is broken unexpectedly,
calling the event triggers an exception, since the connection has been
lost.

Will that exception prevent the other event handlers in line from
getting notified?


If so, is there any way to purge the suspected faulty event handler?

Unfortunately, the exception I get (System.Net.WebException) doesn't
have much information as to which event handler triggered it.

Any ideas on this would be very helpful

Thanks
 
Reply With Quote
 
 
 
 
Christoph Wienands
Guest
Posts: n/a
 
      30th Jan 2004
Hi GS,

> I'm trying to figure out the behavior of an event when one of the
> event handlers triggers an exception.
>
> In my case, I'm using events so the server can contact the client
> using Remoting.
>
> Each client registers its own event handler for the servers event.
>
> Hower, if one of the client connections is broken unexpectedly,
> calling the event triggers an exception, since the connection has been
> lost.
>
> Will that exception prevent the other event handlers in line from
> getting notified?


From what I know, the event handlers will be called in the sequence that
they registered. That means if there are 100 clients, 100 sequential and
probably synchronous event calls are made. I can't tell you anything about
the exception but it shouldn't be hard to find that out. Register to clients
with as event handlers, kill the first one and raise the event. If the
second gets the event, you're fine, if not, you're in trouble.

Here is another idea: What if you create your own "event" mechanism? Clients
register a call-back function. The server keeps those in an ArrayList and
performs the calls manually. This way you have full control over exceptions,
plus you could make asynchronous calls that perform virtually parallel.

CU Christoph


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Strange event handler behavior? Registered User Microsoft ASP .NET 3 20th May 2010 10:07 PM
Strange behavior with OnResize event handler and updates in it 6tc1@qlink.queensu.ca Microsoft Dot NET Framework Forms 0 20th Oct 2005 10:36 PM
Exception before event handler is triggered =?Utf-8?B?Sm9hY2hpbQ==?= Microsoft C# .NET 3 28th Mar 2005 05:15 PM
Exception before event handler is triggered =?Utf-8?B?Sm9hY2hpbQ==?= Microsoft C# .NET 0 28th Mar 2005 04:39 PM
Bizarro event handler behavior Paul Microsoft ASP .NET 2 27th Nov 2003 01:20 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:40 AM.