Re: accessing to a windows service by Alexander
Alexander
Tue Aug 12 13:37:57 CDT 2003
> It all depends on what you want to do.
when i programmed on DCOM/COM+, i created an ATL project as a windows
service (NT service), then added an ATL class. the service part keeps, for
example, a collection, i could get an access from COM-part of the project
to. as a result, i could start the service on a computer and get an access
from any other COM-compatible clients (c++, vb, asp applications) to this
collection (alone for the service). besides, the service could manage its
collection (check for expiration time and delete expired items, for
example). it was very useful.
so, i'm looking something similar in the .NET ideology.
> ServiceController allows you to
> 'send' a custom 'control message' to the service through ExecuteCommand,
> this is handled by your implementation of ServiceBase.OnCustomCommand.
> ExecuteCommand goes through the Service Control Manager, os it can be
called
> by another process. Of course, you cannot pass data or get results through
> this method. To do that you should either implement the service as a .NET
> remoting server (as has been suggested) or you could use the .NET sockets
> classes and implement a socket server. This second option has the
advantage
> that any code can call the socket server.
ServiceController has very limited possibilities to manage the service -
only start, stop, etc. but i need to communicate with the service. besides,
i need to keep objects (for example, .NET-instances) in its collection.
so, probably, it makes sence to take a look at .NET remoting servers..
thanks anyway.
---
mr.black's here...