By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,958 Members | 1,179 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,958 IT Pros & Developers. It's quick & easy.

Communication Between Service and Form Application

P: n/a
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?
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi,

Look at this article which shows how to communicate between a client
application and windows service. It uses Custom commands to communicate with
windows service.

<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvsm02/html/vs0201dt.asp>

Hope it helps...

Regards,
Madhu

Microsoft C# MVP | MCSD.NET

"BizzyTalking" wrote:
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?

Nov 16 '05 #2

P: n/a
Yes, I have taken a look at the custom commands, and have been successful in
sending a command to the service. All that I need to do now, I guess, is
find a way of using Remoting to talk back to the application.

Either that, or use a database, which I have to say, is not my preferred
choice for this particular problem.

Thanks for your guidance.

"Madhu[C#-MVP]" wrote:
Hi,

Look at this article which shows how to communicate between a client
application and windows service. It uses Custom commands to communicate with
windows service.

<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvsm02/html/vs0201dt.asp>

Hope it helps...

Regards,
Madhu

Microsoft C# MVP | MCSD.NET

"BizzyTalking" wrote:
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?

Nov 16 '05 #3

P: n/a

"BizzyTalking" <Bi**********@discussions.microsoft.com> wrote in message
news:66**********************************@microsof t.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
Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.