Singleton .NET Remoting -- How to Shut Down

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?
 
S

Steve Lutz

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:
 
G

Guest

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top