[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Re: Keeping Track of Number of Proxies

Ken Kolda

9/15/2004 10:15:00 PM

This is the danger of using .NET events over remoting. You should probably
read:

http://www.dotnetjunkies.com/Tutorial/BFB598D4-0CC8-4392-893D-30252E2...

Ken


"Emmanuel Kitonyo via .NET 247" <anonymous@dotnet247.com> wrote in message
news:uf2DdS1mEHA.3392@TK2MSFTNGP15.phx.gbl...
Hi

I have a singleton remote object that multiple clients instantiate proxies
of. When one client is shut down, all the other clients stop receiving
events from the singleton and an error is generated when the event is
raised. When there is only one client active and it is disconnected, if a
new proxy is instantiated, it receives twice the number of events it was
receiving - as though the original proxy was not destroyed.

How do I keep track of the number of proxies that have been created, and how
do I destroy them? Calling UnregisterChannel does not seem to prevent
events from the original proxy from coming through when I create a new
proxy.

I appreciate your help.

--------------------------------
From: Emmanuel Kitonyo

-----------------------
Posted by a user from .NET 247 (http://www.dotn...)

<Id>ReJ1at6nkk6JZewfQ682zQ==</Id>


1 Answer

emmanuel

9/16/2004 7:32:00 AM

0

Thanks, Ken. The article you pointed me to helped - now a dead client
does not cause the still active clients to stop receiving events.

However, I have a different, though maybe related, problem: If I call
Activator.GetObject and then destroy the proxy about 8 to 10 times,
subsequent creations of a proxy do not receive events.

There is no error creating the proxy but it simply doesn't receive
events any more. What is the correct way to dispose of a proxy that I
don't need any more? I am destroying the proxy by setting it to
Nothing - but I leave the communication channel alive so that a new
proxy creation can use it.

Once again, your help is much appreciated.

Emmanuel.

"Ken Kolda" <ken.kolda@elliemae-nospamplease.com> wrote in message news:<OY$e0F3mEHA.324@TK2MSFTNGP11.phx.gbl>...
> This is the danger of using .NET events over remoting. You should probably
> read:
>
> http://www.dotnetjunkies.com/Tutorial/BFB598D4-0CC8-4392-893D-30252E2...
>
> Ken
>
>
> "Emmanuel Kitonyo via .NET 247" <anonymous@dotnet247.com> wrote in message
> news:uf2DdS1mEHA.3392@TK2MSFTNGP15.phx.gbl...
> Hi
>
> I have a singleton remote object that multiple clients instantiate proxies
> of. When one client is shut down, all the other clients stop receiving
> events from the singleton and an error is generated when the event is
> raised. When there is only one client active and it is disconnected, if a
> new proxy is instantiated, it receives twice the number of events it was
> receiving - as though the original proxy was not destroyed.
>
> How do I keep track of the number of proxies that have been created, and how
> do I destroy them? Calling UnregisterChannel does not seem to prevent
> events from the original proxy from coming through when I create a new
> proxy.
>
> I appreciate your help.
>
> --------------------------------
> From: Emmanuel Kitonyo
>
> -----------------------
> Posted by a user from .NET 247 (http://www.dotn...)
>
> <Id>ReJ1at6nkk6JZewfQ682zQ==</Id>