In searching this site, i have seen plenty of posts and answers detailing how
to check the status of a service.
Many services, however, will "hang". Their status says that are running,
but in reality the service is non-responsive.
In light of this, I am using the ExecuteCommand method of the specified
servicecontroll er to "ping" teh service. In that method I pass it a command
(an arbitrary number higher than 245). My understanding is that Services
will ignore commands that they don't recognize. Such as:
If ServiceName.Sta tus = Servicecontroll erStatus.runnin g then
ServiceName.Exe cutecommand(248 )
end if
My thinking is that if the service is "hung" or nonresponsive, it will error
out and fall into my Try-Catch which tells me it is hung, otherwise it will
just ignore the command and continue.
Is my thinking correct in this?
Scott
--
Thanks,
Scott 1 2362
If you do what you indicate and the service is not 'geared-up' to handle
that command you will get an InvalidOperatio nException, as is stated in the
documentation for the ServiceControll er.ExecuteComma nd method.
A 'well behaved' service will, when it fails internally, write appropriate
messages to the EventLog and take itself down cleanly.
As you have noticed, not all services are 'well-behaved'. Unfortunately
there isn't much you can do about this other than go to the supplier of the
service, thump the table and demand that they 'play the game'.
"SQLScott" <SQ******@discu ssions.microsof t.com> wrote in message
news:9D******** *************** ***********@mic rosoft.com... In searching this site, i have seen plenty of posts and answers detailing how to check the status of a service.
Many services, however, will "hang". Their status says that are running, but in reality the service is non-responsive.
In light of this, I am using the ExecuteCommand method of the specified servicecontroll er to "ping" teh service. In that method I pass it a command (an arbitrary number higher than 245). My understanding is that Services will ignore commands that they don't recognize. Such as:
If ServiceName.Sta tus = Servicecontroll erStatus.runnin g then ServiceName.Exe cutecommand(248 ) end if
My thinking is that if the service is "hung" or nonresponsive, it will error out and fall into my Try-Catch which tells me it is hung, otherwise it will just ignore the command and continue.
Is my thinking correct in this?
Scott
-- Thanks,
Scott This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Nathan Kovac |
last post by:
I have a feeling I am missing something simple, but I just can't find it.
Perhaps someone can give me a lead on where to look. I will describe the
issue then post my code to the web service. My issue is simply getting
timers to work. I have a DatabaseManager.DataManagerFacade which contains a
timer. Every 6 seconds it updates stock data using an online webservice. I
wrote have 2 possible startup projects to make the service work. One...
|
by: Scott Davies |
last post by:
Hi,
I'm looking for some help on a small program that I'm trying to develop in
VB.NET. I'm having trouble getting the code that I've written to work, can
anyone shed some light as to where I'm going wrong.
The program has been written to do the following tasks:
- Select remote server
- Select from two specific services
|
by: Scott Davies |
last post by:
Hi,
I'm looking for some help on a small program that I'm trying to develop in
VB.NET.
The program I'm trying to develop needs to be able to do the following:
- Select remote server
- Select from two specific services
- Check the status of the server
|
by: Przemo |
last post by:
Is it possible to start or stop a windows service from ASP.NET 2.0?
Some examples?
thanks
Przemo
|
by: tshad |
last post by:
What would be a good way to check programmatically whether a service was
running?
We have a service that dies periodically and I need to check to see if this
service is running. I know how to check to see if the status is in stopped
or running mode. But that doesn't tell me if it is actually running.
I need to know this so that if it happens I can programmatically start the
same service on another machine.
| |
by: =?Utf-8?B?RGFuZGFuIFpoYW5n?= |
last post by:
Now I have a web application, a web service and a SQL Server database.
The Web application will invoke the web service, the web service
invokes the SQL Server stored procedure.
I let the web service run in an application pool which runs under a
domain user, this domain user has permissions of accessing database and the
connection to database is trusted connection. All these work well.
The web application will be used in internet (not...
|
by: =?Utf-8?B?TWFyaw==?= |
last post by:
Hi...
Following the samples online, we implemented a windows service in .Net.
Like most services, there's a worker thread actually doing stuff in the
background. The problem we've run into is how to get the service to exit
when the worker thread has a fatal error *and* get the SCM to invoke the
auto-restart configuration?
The worker thread can error out while the parent thread in the server
process chugs along. We can set the exit...
|
by: =?Utf-8?B?VzFsZDBuZTc0?= |
last post by:
I need to create a Windows Service, which will be hosting a couple of worker
classes, each in there own thread. I will be creating a tray Icon (Notify
Icon) and a windows form to manage this service.
I can send custom commands to start or stop or... any of the worker objects
that the windows service will be hosting.
What I need to do is to get some information back to the Tray Icon app or
the windows form about the actual worker items...
|
by: =?Utf-8?B?RGlvZ28gQWx2ZXMgLSBTb2Z0d2FyZSBEZXZlbG9w |
last post by:
Greetings,
I would like to create a windows service that would expect an event from my
software to import data from a device and/or to import data in scheduled times
My questions are:
- How can I tell the windows service to import data from another application?
- Is it possible to have a UI for the service, like a tray icon with the
status of the service?
|
by: Sylvie |
last post by:
My Windows Application has two forms, one form contains a grid (lets say
Stock Listing), and the other is a form of one stock, contains some edit
boxes for one stock's fields..
Is it possible to run application remotely and retrieve grid and form data
in some way without accessing directly to database server?
Web Services is being used for this purpose I think,
Which methods must be used for this ?
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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...
|
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...
|
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,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
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();...
| |
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...
|
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
| |