"BizzyTalki ng" <Bi**********@d iscussions.micr osoft.com> wrote in message
news:66******** *************** ***********@mic rosoft.com...
Would any kindly tell me if its possible to communicate between a service
and a form application. For example, retrieve information from the service,
like current activity or progress of its operations. In particular, I would
like to to monitor more than just whether a service is running. In the system
tray I would like to display whether the service is idle, or running a
particular method.
Is this possible? If so, should I be using MSMQ, or something else?
MSMQ is a bit of overkill for what you are looking for - and if your
organization is not already committed to message queuing, it can be a bit
messy trying to get it installed on all potential client workstations.
Remoting does not solve your problem - the remote instance will run is
process A, the service runs in process B - you still have the problem of
process A communicating with Process B.
The link that Madhu provides is OK if you want to communicate with the SCM -
but that does not allow you to communicate with a particular service.
Your service runs in a separate process and to communicate directly with
your custom service you need interprocess communication. There are numerous
technologies available (sockets, shared memory, message passing, named
pipes, plus others). If you want to communicate with a service on another
machine, your options become a bit more restricted. For LAN scope
monitoring, I would tend towards sockets - .Net has good support for
sockets, and performance is fair. Consider a broadcast datagram to locate
the service, then switch to a connected stream type socket to communicate
directly with the service.
regards
roy fine