Greetings,
Let's say I have a Service running on my machine, that has a full object
model of some kind. From an external process, such as a Win application or
Console application, I'd like to be able to do something like:
MyService ms = MyService.GetInstance();
and return an active reference to the service so I can then use the object
model for configurations, automation, or even wiring up to events/callbacks
so I can do some debugging and such.
How would I go about making GetInstance() return a reference to the active
service (not create a new one). It is conceivable that multiple
applications might want a reference simultaneously.
Thanks,
Shawn
hB - 22 Apr 2006 15:00 GMT
Out of Process DotNet Remoting Server.
(DCOM or Enterprise Services in dotnet)
---
hB
Ben Voigt - 03 May 2006 19:27 GMT
> Greetings,
>
[quoted text clipped - 11 lines]
> service (not create a new one). It is conceivable that multiple
> applications might want a reference simultaneously.
How are you going to synchronize the requests so that state isn't corrupted?
Access from multiple applications implies multiple, highly independent
threads.
Much better IMHO is to create a named pipe in the service and apply an
appropriate DACL, or a socket and do your own authorization, and then create
a managed client library in which GetInstance returns a new proxy object.
Pass requests through the pipe/socket (I think you can use the Marshal APIs
to help with this). This approach gives you remote management at no
additional charge.
> Thanks,
> Shawn
Shawn B. - 04 May 2006 05:17 GMT
> Much better IMHO is to create a named pipe in the service and apply an
> appropriate DACL, or a socket and do your own authorization, and then
> create a managed client library in which GetInstance returns a new proxy
> object. Pass requests through the pipe/socket (I think you can use the
> Marshal APIs to help with this). This approach gives you remote
> management at no additional charge.
Sounds like a good idea. Makes sense, too.
Thanks,
Shawn