Home All Groups Group Topic Archive Search About

Passing parameters to a windows service

Author
9 Jun 2006 6:44 PM
basulasz
Is it possible to pass a parameter to a "running" windows service on
background? I am developing a program such the in a random manner some
entries are being added to MSMQ Queues. The windows service application have
to work when an entry added to a queue. How can i invoke such a a service?

Author
12 Jun 2006 12:18 PM
Vadym Stetsyak
Hello, basulasz!

b> Is it possible to pass a parameter to a "running" windows service on
b> background? I am developing a program such the in a random manner some
b> entries are being added to MSMQ Queues. The windows service application
b> have to work when an entry added to a queue. How can i invoke such a a
b> service?

Service has to get that value from queue, or do custom job, when entry is added to the queue?

If the latter you can consider any IPC mechanism ( sockets, named pipes, remoting, MMF, etc )
OTOH if you want that value hava a look at
( http://www.codeproject.com/csharp/mgpMyQueue.asp )
( http://www.csharphelp.com/archives3/archive581.html )

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Author
15 Jun 2006 7:01 AM
basulasz
The service should be aware of received messages when a messege is sent to
the queue. And have to take the message as a parameter, and  then it should
send sms message to a gsm number according to the parameter. Sending sms is
ok. But currently i check the queue with periodic intervals, and do my job
according to added messages.

Show quote
"Vadym Stetsyak" wrote:

> Hello, basulasz!
>
>  b> Is it possible to pass a parameter to a "running" windows service on
>  b> background? I am developing a program such the in a random manner some
>  b> entries are being added to MSMQ Queues. The windows service application
>  b> have to work when an entry added to a queue. How can i invoke such a a
>  b> service?
>
> Service has to get that value from queue, or do custom job, when entry is added to the queue?
>
> If the latter you can consider any IPC mechanism ( sockets, named pipes, remoting, MMF, etc )
> OTOH if you want that value hava a look at
> ( http://www.codeproject.com/csharp/mgpMyQueue.asp )
> ( http://www.csharphelp.com/archives3/archive581.html )
>
> --
> Regards, Vadym Stetsyak
> www: http://vadmyst.blogspot
Author
15 Jun 2006 9:12 AM
Vadym Stetsyak
Hello, basulasz!

b> The service should be aware of received messages when a messege is sent to
b> the queue. And have to take the message as a parameter, and  then it should
b> send sms message to a gsm number according to the parameter. Sending sms is
b> ok.

You can develop notification mechanism. if your message consumer and producer "live" on the same machine - 
global sync mecanisms can be used ( named mutex, or system wide event ); if they work on
different machines then you can develop custom notification mechanism either using TCP, or
.NET Remoting.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com

AddThis Social Bookmark Button