Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
|
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 30th, 2006, 04:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default Service Starts and Stops

Hi all,
I have created a windows service with .net 2.
I have installed the service but when I try to start it I get a message that the service has started and stopped as there was nothing to do.
I have noticed from some other similar problems on the net that this may be due to a thread not being started for each service.
There are three seperate services that I wish to run in this process and I have started them all from the program page like so:
Code:
static void Main()
        {
            ServiceBase[] ServicesToRun;
            ServicesToRun = new ServiceBase[] { 
                new SmsReceive(), 
                new SmsSend(),
                new SmsRouting()
            };
            ServiceBase.Run(ServicesToRun);
        }
In each of the services there is code like so:
Code:
        protected override void OnStart(string[] args)
        {
            // TODO: Add code here to start your service.
            PortUtilities.OpenPort(serialPort, ReceiveGsmModemPort);
            serialPort.DataReceived += new SerialDataReceivedEventHandler(serialPort_DataReceived);
            Watch();            
        }
SO each has some kind of loop to continue watching either a GSM Modem or a Message Queue.

How can I get these services running in processes that will not stop?

Many thanks for your time in advance.
Rod


======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
__________________
======================================
"They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad."
--Shakespeare
======================================
 
Old January 30th, 2006, 04:30 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

My mistake, wrong forum, I've moved question to http://p2p.wrox.com/topic.asp?TOPIC_ID=39306


======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================





Similar Threads
Thread Thread Starter Forum Replies Last Post
Tomcat suddenly stops after starts annumol Apache Tomcat 2 February 9th, 2008 01:32 PM
Windows Service Starts and Stops rodmcleay C# 1 May 13th, 2007 05:16 PM
Windows service suddenly stops work. shai5 .NET Framework 1.x 0 August 14th, 2006 01:25 AM
Application starts again sarvesh189 Forum and Wrox.com Feedback 2 May 25th, 2005 02:07 AM
get error when SELECT search starts with "@" abbylee26 Classic ASP Databases 1 March 15th, 2004 03:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.