Let me explain a little better. I want to create a remote object which
contains a thread so it does work even when no client is attached. I want to
create a process which has an interface which can be accessed via .net
remoting. A singleton seems like the best solution. Right now I have my
thread started in my remote classes constructor. In my tests the thread is
not started until the first client attaches (thus, I assume, creating the
remote object) for the first time). I need a way to create the remote object
and thus start the thread whenever the host app is started not after the
first client attaches.
Ralph
[quoted text, click to view] "Leon Welicki" wrote:
> Hi Ralph,
>
> Why would you want to call the constructor of the singleton? The constructor
> in the singleton pattern specified in the GoF book is protected
>
> Here is an excerpt of the pattern in the GoF, taken from the Implementation
> section of the Singleton pattern in the book "Design Patterns"
>
> <i>"Notice that the constructor is protected. A client that tries to
> instantiate Singleton directly will get an error at compile-time. This
> ensures that only one instance can ever get created."</i>
>
> Take a look at this article, that explains several ways to implement the
> Singleton pattern in C#
>
>
http://www.yoda.arachsys.com/csharp/singleton.html
>
> if you are working with remoting, maybe you would find this article
> interesting
>
>
http://www.codeproject.com/dotnet/remotingsingleton.asp >
>
> Hope this helps,
> Regards,
> Leon
>
> "Ralph Flaugher" wrote:
>
> > I am creating a singleton server object. I would like to have the host
> > application call the server object's constructor. It appears that the
> > singleton object is not created until the first client attaches.
> >
> > --