How to remove delegate from Invocation List? (remote eventing)

  • Thread starter Thread starter Lex
  • Start date Start date
L

Lex

I have an app that allows for cross process eventing. I have a server
that instantiates a shared object that external processes can remotely
get a refernce to and register for events.

The problem I have is when one of the clients die uncleanly without
unregistering for the event. The remote object does not know that the
client is gone an still tries to call the delegate for that client.
This results in a socket exception after a few seconds.

Is there a clean way to deal with this? Is there a way to have the
remote object remove the dead client's delegate from the event's
Invocation list if it fails with a given exception?

Regards
 
IIRC, Chris Sells has an excellent essay on cross-process events & delegates that should point you in the right direction... I believe it's on his website (sellsbrothers.com) as well as being included in his book, Windows Forms Programming in C#.
 
Back
Top