Thanks for your answer Robert!

> That's not the real reason why they are GCed. If an object
> is casted to one of its interface it still remains the
> same object.
> 
> If the client is implementing IClient while subclassing
> MarshalByRefObject, the usual remoting lifetime constraints
> will take effect.
> 
> You can control the lifetime (on the client) by overriding
> InitializeLifetimeServices.

I see. But I am using also a null value for the return value of 
InitializeLifetimeService in the client, because I want the client to 
keep connected until normal program termination (or CTRL-C hitted by the 
user at the client machine), which will actually garbage collect the 
whole process.

Snippet:

class Client : MarshalByRefObject, IClient
{
   public override object InitializeLifetimeService()
   {
     return null;
   }

   /* methods of IClient interface... */
}


> The IClient proxy (on the server) is subject to be GCed after
> it's removed from the hClients dictionary

That's the thing I was unsure about, thanks for pointing out!

Regards,

        Andrés  [ knocte ]

-- 

_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to