Sunny
7/24/2004 2:41:00 AM
Hi Sylvain,
MyRemObj myremobj = new MyRemObj();
RemotingServices.Marshal(myremobj, "MyRemObjUri", typeof(myremobj));
And do not use RegisterWellKnown...
Now, all clients will connect on that instance on the uri MyRemObjUri, and
you can access it internally by myremobj.
Sunny
P.S. as part of the education :), please try next time to use
groups.google.com. A simple search of "remoting singleton access locally"
displays at least 10 answers to this question. It is asked every other day.
At least it can save you some time while wait for the answer.
Sylvain Ross wrote:
> Hi,
>
> I'm publishing a class through the
> RemotingConfiguration.RegisterWellKnownServiceType, as a Singleton.
>
> Everything works fine. An instance of the published class get created
> once a remote client try to access it. Then, since I'm working with
> Singleton, every other remote client acessing with this class will be
> using the same instance. Great..
>
> The problem is that I would like right after starting (or even at the
> same time !) the publishing of my object, to instantiate it.
>
> Yes I can do dim n as new MyPublishedClass() right after the Registering
> for publishing. But when the first remote client ask for the published
> class, it's creating a brand new object.
>
> I also tried to kind of access my published object from local, like a
> remote client would have do, but It doesnt work.
>
>
> Roughly, I would like to be able to instanciate explicitly a published
> object. And this instanciation would be considered as the published
> singleton object.
>
>
> Thx in advance.