473,666 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Solution for the Error : The service did not respond to the Stop call in a timely fashion

Hi,
I am writing a service which takes a long time to stop after the OnStop
call is given by the Services Snap-in. The problem is I cannot cut down on
the time that it takes to Stop. The Service snap-in gives me the error
saying that the service did not respond to the Stop call in a timely
fashion. So is there any method by which I can get around this problem.

Thanks
Prasad


Sep 28 '05 #1
2 2844
Sure. You can run the job in a separate thread than the main execution
thread. Calling Stop will send a message to the child thread instructing it
to stop itself, and the main execution thread can continue processing. This
is what is called an "asynchrono us" operation, as opposed to a "blocking"
operation.

For example, I have a service that runs a certain kind of job. The service
doesn't actually do the job; an instance of a class that exists in the
service runs the job. The OnStart method of the Service calls the class's
"Start" method, which spawns a chilc thread executing the "Run" method of
the class. The OnStop method of the service calls the class's "Stop" method,
which sets a property in the class, which the child thread looks at from
time to time. The "Stop" method then continues on its way. The child thread
looks at the property, sees that it needs to stop, and stops itself.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Big things are made up of
lots of little things.

"Prasad" <ek*********@ya hoo.co.uk> wrote in message
news:um******** ******@TK2MSFTN GP11.phx.gbl...
Hi,
I am writing a service which takes a long time to stop after the OnStop
call is given by the Services Snap-in. The problem is I cannot cut down on
the time that it takes to Stop. The Service snap-in gives me the error
saying that the service did not respond to the Stop call in a timely
fashion. So is there any method by which I can get around this problem.

Thanks
Prasad

Sep 28 '05 #2
Thnx man.
But I had done the same thing what u suggested but the problem is the
Service Snap - in shows that the service has stopped but there is still the
background thread running which means that the process is still running. I
dont want this to happen. I want to negotiate with the SCM on the time and
it should show that the Service stopped if the process is really completed.

Thanks
Prasad

"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:uX******** ******@TK2MSFTN GP09.phx.gbl...
Sure. You can run the job in a separate thread than the main execution
thread. Calling Stop will send a message to the child thread instructing
it to stop itself, and the main execution thread can continue processing.
This is what is called an "asynchrono us" operation, as opposed to a
"blocking" operation.

For example, I have a service that runs a certain kind of job. The service
doesn't actually do the job; an instance of a class that exists in the
service runs the job. The OnStart method of the Service calls the class's
"Start" method, which spawns a chilc thread executing the "Run" method of
the class. The OnStop method of the service calls the class's "Stop"
method, which sets a property in the class, which the child thread looks
at from time to time. The "Stop" method then continues on its way. The
child thread looks at the property, sees that it needs to stop, and stops
itself.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Big things are made up of
lots of little things.

"Prasad" <ek*********@ya hoo.co.uk> wrote in message
news:um******** ******@TK2MSFTN GP11.phx.gbl...
Hi,
I am writing a service which takes a long time to stop after the
OnStop
call is given by the Services Snap-in. The problem is I cannot cut down
on
the time that it takes to Stop. The Service snap-in gives me the error
saying that the service did not respond to the Stop call in a timely
fashion. So is there any method by which I can get around this problem.

Thanks
Prasad


Sep 29 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
10089
by: Water Cooler v2 | last post by:
It was all good when a few days ago, I started getting this error on my Windows 2000 Professional SP4 box when trying to start IIS 5.5. "The service did not respond to the start or control request in a timely fashion." I have .NET v1.1 and so I googled for this error. I got a few links, one of which, from the MS KB suggested that I install .NET v1.1 SP 1. I found I already had SP1 for .NET v1.1. However, I downloaded it again
2
376
by: Prasad | last post by:
Hi, I am writing a service which takes a long time to stop after the OnStop call is given by the Services Snap-in. The problem is I cannot cut down on the time that it takes to Stop. The Service snap-in gives me the error saying that the service did not respond to the Stop call in a timely fashion. So is there any method by which I can get around this problem. Thanks Prasad
1
10139
by: magnus.s.olsson | last post by:
I have got a Windows Service application from a customer that I try to start. The customer can start it with no problem, but when I try to start it I get: "Could not start the GateWay service on Local Computer. Error 1053: The service did not respond to the start or control request in a timely fashion."
4
14095
by: whoamir | last post by:
HI GUYS, I am ramesh from mumbai. i am new in this group. i am facing a problem in IIS.its stopped its not running.. when i tryed to restart it its showing The service did not respond to the start or control request in a timely fashion i am using WindowsXp Pro, IIS 5.1. please help to resolve it.
2
9455
by: =?Utf-8?B?Sm9obiBTLg==?= | last post by:
I developed a Windows Service application written in vb.net and have successfully installed it on many workstations (over 25 PCs). All workstations have Windows XP SP2 installed. There are two workstations located at separate customers that have an issue during installation. I receive the error “The service did not respond to the start or control request in a timely fashion.” The service properties Log On is set to use the Local...
3
12407
by: kneidels | last post by:
Hey folks on XPP here. I have always had IIs started by default, but suddenly now i see my default (and only) website is off. i get this message when trying to start it - running iisreset via Run > CMD gives me the following:
6
3354
by: alho | last post by:
The web service is called by a program running on pocket pc. When to call the web service, the first call is still ok, but for the second or later calls, it will throw "403 Forbidden" WebException. When to test it using the web interface on pocket IE, everything is fine. Before there was no such problem, it only happened within a week or so. I suspect it's caused by the server's firewall settings, but how come the first call is ok? This...
0
1767
by: Kristi | last post by:
This is the Command: CPYTOIMPF FROMFILE(LSPMPRDTA/LS600F) + TOSTMF('\KWIKTAG\KWIKTAG.TXT') + MBROPT(*REPLACE) STMFCODPAG(*PCASCII) +
2
17777
by: NitinSawant | last post by:
Dear sir, I've installed SQL Server 2008 on my machine running on Win XP SP3 I changed startup type of sql server from 'Automatic' to 'manual' from the "SQL Server Configuration Manager", when i try to start sql server by right clicking on it I get the error message The request failed or service did not respond in timely fashion, Consult the event log or other application error logs for details
0
8444
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8869
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8551
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5664
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2771
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.