473,379 Members | 1,253 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Need some help with a Service

I have a service where I start up the worker thread from OnStart and also
stop the thread from OnStop. My problem is if the service by itself decides
to stop because of some problem it cannot handle - how wouold it stop, I
mean stop the thread itself is not a problem but the service is still
running.
Owe
Nov 15 '05 #1
2 1136
Who said I don't use try/catch, even then it might be a decision for the
service to give up control since it could be useless to continue - missing
registry entries for instance.

Owe

"Frank Drebin" <no*****@imsickofspam.com> wrote in message
news:rb**********************@newssvr28.news.prodi gy.com...
I don't mean to be a smart-guy, but ESPECIALLY for a service - you should
have try/catch statements on EVERYTHING - so that this is impossible. A
service runs in the System space of memory and if it blows up could take
down the box - it needs to be much more stable than any user application...
"Owe Armandt" <ow*@armandt.se> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I have a service where I start up the worker thread from OnStart and also stop the thread from OnStop. My problem is if the service by itself

decides
to stop because of some problem it cannot handle - how wouold it stop, I
mean stop the thread itself is not a problem but the service is still
running.
Owe


Nov 15 '05 #2

Hi Owe,

I found that in Onstart() you can not stop the service.
May be you can create a new thread and a timer, after some time(after
Onstart method) you use this thread to
stop the service.

Hope this helps.

Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Owe Armandt" <ow*@armandt.se>
| References: <#g**************@TK2MSFTNGP12.phx.gbl>
<rb**********************@newssvr28.news.prodigy.c om>
| Subject: Re: Need some help with a Service
| Date: Tue, 26 Aug 2003 20:36:36 +0200
| Lines: 34
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
| Message-ID: <uO**************@TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: mail.armandt.com 213.88.133.97
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:179592
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Who said I don't use try/catch, even then it might be a decision for the
| service to give up control since it could be useless to continue - missing
| registry entries for instance.
|
| Owe
|
|
|
| "Frank Drebin" <no*****@imsickofspam.com> wrote in message
| news:rb**********************@newssvr28.news.prodi gy.com...
| > I don't mean to be a smart-guy, but ESPECIALLY for a service - you
should
| > have try/catch statements on EVERYTHING - so that this is impossible. A
| > service runs in the System space of memory and if it blows up could take
| > down the box - it needs to be much more stable than any user
| application...
| >
| > "Owe Armandt" <ow*@armandt.se> wrote in message
| > news:%2****************@TK2MSFTNGP12.phx.gbl...
| > > I have a service where I start up the worker thread from OnStart and
| also
| > > stop the thread from OnStop. My problem is if the service by itself
| > decides
| > > to stop because of some problem it cannot handle - how wouold it
stop, I
| > > mean stop the thread itself is not a problem but the service is still
| > > running.
| > >
| > >
| > > Owe
| > >
| > >
| >
| >
|
|
|

Nov 15 '05 #3

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

Similar topics

7
by: sidd | last post by:
Hi All, i have some doubts on .net windows services.. please see if some one could help me understand this.. 1)is it possible to install a windows service which does not have a installer added...
1
by: Camilla | last post by:
I'm making one of my first web services (with C#) and need help getting started. I have received an idl file and a sdl file that describes the interface I need to implement... but how do I...
1
by: VK | last post by:
Hello, I am currently doing a project on Access and am current stuck in the "search" process and hoping that you could help me out. I have got 3 tables designed. When the user clicks on search...
2
by: spidrw | last post by:
I have a system that lets users input service events (much like appointments at a Dr.'s office). Oftentimes a particular person will have 30 or 31 appointments in a month, as all events are...
3
by: sandrina | last post by:
Hello everyone, My name is Debi and I am an Administrative assistant with a large company in their sourcing department. I was hired one month ago, and walked in to a HUGE filing nightmare. My...
1
by: Tressa | last post by:
I have a C# Windows Service and I need to access it from a C++ Application. I am new to programming and have been looking all over for help on the internet without much luck. I did place this...
12
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded...
1
by: Heena Patel | last post by:
Hi, I have a implemented a web service interface that has a webmethod accepting xml, but I need to also have post option available to my webservice. I understand if a client Posts a SOAP...
16
by: pamelafluente | last post by:
I am still working with no success on that client/server problem. I need your help. I will submit simplified versions of my problem so we can see clearly what is going on. My model: A client...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.