I have written an application that runs as a Windows Service. I have also written a small windows forms application to send the service some custom startup parameters. The application is also able to connect to instances of the service on the local machine, as well as remote servers.

I am having trouble deciding the best way to give the client app the ability to retrieve what the current parameters are for a running instance of the service. Actually I am having trouble even deciding where to start as there seem to be a number of possible ways.

Any thoughts? Thanks for any help!

RE: Communicating with a Windows Service by Devin

Devin
Tue Jun 29 18:24:01 CDT 2004

Woah! Sorry for kind of doing a double post. I just noticed the "Network Communications" post from earlier.

RE: Communicating with a Windows Service by Devin

Devin
Tue Jun 29 18:33:02 CDT 2004

Heh, yeah I'm Devin and Kettch, for a second there I forgot which username I use on this forum.

"Devin" wrote:

> Woah! Sorry for kind of doing a double post. I just noticed the "Network Communications" post from earlier.

RE: Communicating with a Windows Service by Accelemetrics

Accelemetrics
Tue Jun 29 23:18:02 CDT 2004

I'm mulling over a similar design problem where I need to communicate between ans service and WinForm application. In my scenario I want to perform configuration updates plus I would like some of the ongoing status information of the service to be displayed in the separate application (perhaps to log window) and also allow for some commands to be sent from the separate application to the service. I'm seen ideas here and there about using remoting, XML disk files, message queing, TCP packets, UDP packets, etc. Normally the the general idea would be to use of of these mechanisms to pass back and forth objects (serialized as XML) containing (in my case) log or command data. Unfortunately, almost every article I've seen focuses on the mechanics of building a Win Service with no comments about good practices for communicating with 'em.

--Danny Lee


"kettch" wrote:

> I have written an application that runs as a Windows Service. I have also written a small windows forms application to send the service some custom startup parameters. The application is also able to connect to instances of the service on the local machine, as well as remote servers.
>
> I am having trouble deciding the best way to give the client app the ability to retrieve what the current parameters are for a running instance of the service. Actually I am having trouble even deciding where to start as there seem to be a number of possible ways.
>
> Any thoughts? Thanks for any help!

RE: Communicating with a Windows Service by jchREMOVE

jchREMOVE
Wed Jun 30 02:40:01 CDT 2004

I have done this using remoting and it works perfectly. My service is running on a server and the user interface can be run on any client machine. For the client to receive notifications from the service, I use the Observer Design Pattern from "Gang of Four" to avoid any remoting problems with the usual .net events.

Regards, Jakob.


"Accelemetrics" wrote:

> I'm mulling over a similar design problem where I need to communicate between ans service and WinForm application. In my scenario I want to perform configuration updates plus I would like some of the ongoing status information of the service to be displayed in the separate application (perhaps to log window) and also allow for some commands to be sent from the separate application to the service. I'm seen ideas here and there about using remoting, XML disk files, message queing, TCP packets, UDP packets, etc. Normally the the general idea would be to use of of these mechanisms to pass back and forth objects (serialized as XML) containing (in my case) log or command data. Unfortunately, almost every article I've seen focuses on the mechanics of building a Win Service with no comments about good practices for communicating with 'em.
>
> --Danny Lee
>
>
> "kettch" wrote:
>
> > I have written an application that runs as a Windows Service. I have also written a small windows forms application to send the service some custom startup parameters. The application is also able to connect to instances of the service on the local machine, as well as remote servers.
> >
> > I am having trouble deciding the best way to give the client app the ability to retrieve what the current parameters are for a running instance of the service. Actually I am having trouble even deciding where to start as there seem to be a number of possible ways.
> >
> > Any thoughts? Thanks for any help!

RE: Communicating with a Windows Service by allonb

allonb
Mon Jul 19 05:46:57 CDT 2004

Hi,

Can you please give some more details about how you were able to host a remoting server in your service and have that server control your service.

I have managed to find many samples on how to host remoting objects in a Windows service but I am unsure how you use one of those objects to control the service.

Thanks

---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.

RE: Communicating with a Windows Service by Sunny

Sunny
Mon Jul 19 09:03:15 CDT 2004

Hi,

if in your service you create a static remoting object, and after that
you do not use WellKnownServiceType, but RemotingServices.Marshal of
that object, it will be exposed as a Singleton, and in your service you
will still have a reference to it. So, when you create that object, you
can pass to it a reference of the your main object, which have to be
controlled. And upon a client request, it will do something on the
service.

Sunny


In article <OAQj32XbEHA.3996@TK2MSFTNGP12.phx.gbl>, allonb says...
> Hi,
>
> Can you please give some more details about how you were able to host a remoting server in your service and have that server control your service.
>
> I have managed to find many samples on how to host remoting objects in a Windows service but I am unsure how you use one of those objects to control the service.
>
> Thanks
>
> ---
> Posted using Wimdows.net NntpNews Component -
>
> Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
>