Singleton .NET Remoting -- How to Shut Down

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to share a single socket among many clients so I am thinking that a singleton .NET remoting project would work well. I do need to be able to stop it though. If I override as recommended

public class MyClass : MarshalByRefObjec

public override Object InitializeLifetimeService(

return null



how do I get it to shut down?
 
Hi Sue,

I think that the object will shutdown when the server/listener that creates
the actual object shuts down.

Steve


Sue said:
I need to share a single socket among many clients so I am thinking that a
singleton .NET remoting project would work well. I do need to be able to
stop it though. If I override as recommended:
 
According to the documentation it keeps going "as long as the host application domain is running". It is created when it is called and all subsequent callers talk to the same object. It isn't created by a "new". Since it isn't created by a "new" I guess I'm not sure what the "host application domain" is.
 
The "host application domain" is the AppDomain which host your object. This
typically is:

- IIS if the object is hosted by IIS
- A Windows Service, if the object is hosted by a windows service
- A custom app, If you created a custom application.

Bennie Haelen

Sue said:
According to the documentation it keeps going "as long as the host
application domain is running". It is created when it is called and all
subsequent callers talk to the same object. It isn't created by a "new".
Since it isn't created by a "new" I guess I'm not sure what the "host
application domain" is.
 
Back
Top