Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / May 2006

Tip: Looking for answers? Try searching our database.

Reference a Service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Shawn B. - 22 Apr 2006 00:15 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.