Hi,
I have a working windows service,it is looking for files on the disk
and when some of the files are cupdated it calls an executable. But it
takes a lot of time(about 10 minutes) to run the executable.So while
that executable is running,if I try to stop the windows service while
the executable(MYPROGRAM.EXE) is running,it will wait for a time(about
20 seconds) for the main windows thread to abort.If it does not finish
its work, the service process is killed AUTOMATICALLY and tells
something like "the service did not stop ina timely fashion".
As the windows service will never be able to finish its work under a
minute,
my service always is stooped by WINDOWS and got the message "the
service did not stop ina timely fashion".
I need a asynchronous way to execute the MYPROGRAM.EXE in a different
process than the windows service process so that even if the service
stops,if MYPROGRAM.EXE will continue to run..
One way to do is to call a web service method asynchronously which
executes MYPROGRAM.EXE ...So the .NET code for the windows service
will not suspend when it calls the windows service method. and will
stop ina timely fashion when it is signaled. But I think there should
be better ways of implementing it without using IIS.
I'll appreciate very much if you help... 3 4994
Why do you want to stop the service in the first place? Windows services are
generally ment to run from boot-up to shutdown.
How do you start the external process? A code snippet would help.
Willy.
"belgiozen" <be*******@yahoo.com> wrote in message
news:4e**************************@posting.google.c om... Hi,
I have a working windows service,it is looking for files on the disk and when some of the files are cupdated it calls an executable. But it takes a lot of time(about 10 minutes) to run the executable.So while that executable is running,if I try to stop the windows service while the executable(MYPROGRAM.EXE) is running,it will wait for a time(about 20 seconds) for the main windows thread to abort.If it does not finish its work, the service process is killed AUTOMATICALLY and tells something like "the service did not stop ina timely fashion". As the windows service will never be able to finish its work under a minute, my service always is stooped by WINDOWS and got the message "the service did not stop ina timely fashion".
I need a asynchronous way to execute the MYPROGRAM.EXE in a different process than the windows service process so that even if the service stops,if MYPROGRAM.EXE will continue to run..
One way to do is to call a web service method asynchronously which executes MYPROGRAM.EXE ...So the .NET code for the windows service will not suspend when it calls the windows service method. and will stop ina timely fashion when it is signaled. But I think there should be better ways of implementing it without using IIS.
I'll appreciate very much if you help...
fork a thread in your service's main routine to do that work, then the main
service checking can be happy and you'll get the results you need when they
are ready.
--
Eric Newton
C#/ASP Application Developer http://ensoft-software.com/ er**@cc.ensoft-software.com [remove the first "CC."]
"belgiozen" <be*******@yahoo.com> wrote in message
news:4e**************************@posting.google.c om... Hi,
I have a working windows service,it is looking for files on the disk and when some of the files are cupdated it calls an executable. But it takes a lot of time(about 10 minutes) to run the executable.So while that executable is running,if I try to stop the windows service while the executable(MYPROGRAM.EXE) is running,it will wait for a time(about 20 seconds) for the main windows thread to abort.If it does not finish its work, the service process is killed AUTOMATICALLY and tells something like "the service did not stop ina timely fashion". As the windows service will never be able to finish its work under a minute, my service always is stooped by WINDOWS and got the message "the service did not stop ina timely fashion".
I need a asynchronous way to execute the MYPROGRAM.EXE in a different process than the windows service process so that even if the service stops,if MYPROGRAM.EXE will continue to run..
One way to do is to call a web service method asynchronously which executes MYPROGRAM.EXE ...So the .NET code for the windows service will not suspend when it calls the windows service method. and will stop ina timely fashion when it is signaled. But I think there should be better ways of implementing it without using IIS.
I'll appreciate very much if you help...
The background thread being forked by the main thread will be killed
by the runtime when the service is stopped.So that's not the solution
in my opininion.
Maybe Process Class will help me do that.. starting the exe in a
different process to avoid it being killed even if the service process
stops....
"Eric Newton" <er**@cc.ensoft-software.com> wrote in message news:<#d*************@TK2MSFTNGP11.phx.gbl>... fork a thread in your service's main routine to do that work, then the main service checking can be happy and you'll get the results you need when they are ready.
-- Eric Newton C#/ASP Application Developer http://ensoft-software.com/ er**@cc.ensoft-software.com [remove the first "CC."]
"belgiozen" <be*******@yahoo.com> wrote in message news:4e**************************@posting.google.c om... Hi,
I have a working windows service,it is looking for files on the disk and when some of the files are cupdated it calls an executable. But it takes a lot of time(about 10 minutes) to run the executable.So while that executable is running,if I try to stop the windows service while the executable(MYPROGRAM.EXE) is running,it will wait for a time(about 20 seconds) for the main windows thread to abort.If it does not finish its work, the service process is killed AUTOMATICALLY and tells something like "the service did not stop ina timely fashion". As the windows service will never be able to finish its work under a minute, my service always is stooped by WINDOWS and got the message "the service did not stop ina timely fashion".
I need a asynchronous way to execute the MYPROGRAM.EXE in a different process than the windows service process so that even if the service stops,if MYPROGRAM.EXE will continue to run..
One way to do is to call a web service method asynchronously which executes MYPROGRAM.EXE ...So the .NET code for the windows service will not suspend when it calls the windows service method. and will stop ina timely fashion when it is signaled. But I think there should be better ways of implementing it without using IIS.
I'll appreciate very much if you help... This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Yitzhak |
last post by:
I am having "Permission denied" error while calling
LogEvent method of WScript.Shell component.
Basically, ASP page calls Windows Script Host Shell...
|
by: belgi |
last post by:
Hi,
I have a working windows service,it is looking for files
on the disk
and when some of the files are cupdated it calls an
executable. But it...
|
by: Brian Keating EI9FXB |
last post by:
Hello all,
Wonder what approach is used for this problem.
I have a MDIApplication, the MDIClinets are to be in a seperate thread.
So I've done...
|
by: Bucky Pollard |
last post by:
I have a web service that needs to create a batch file and call it (since
there are no APIs for the functionality I am looking for). I am using the...
|
by: Stu |
last post by:
Hi,
I have a web service which returns a record set and works well integrated
with an asp dot net page.
However if I decided to develop a unix...
|
by: fdmaxey |
last post by:
I have created a small windows application in VB.Net that produces a
series of charts and write them automatically to a Power Point document,
based...
|
by: GD |
last post by:
Hi,
I am trying to call a webservice from a windows service application. It
works only if I launch the windows service app from VS.Net 2005...
|
by: =?Utf-8?B?UG1hX1NoYW5l?= |
last post by:
I am wring asp webservices in managed c++ for IIS 5.1 runing on XP SP2. Even
though I set the aplication protection to High (Isolated), each...
|
by: mariescottandeva |
last post by:
Hi,
I need to call an old C DLL from my Web Service. This in itself is
fine and I am able to do this no problem. My issue is that I need to...
|
by: better678 |
last post by:
Question:
Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct?
Answer:
Java is an object-oriented...
|
by: CD Tom |
last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
|
by: jalbright99669 |
last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was...
|
by: Matthew3360 |
last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
Here is my code.
...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
|
by: AndyPSV |
last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
| |